Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
.Net Core 2 Spy Test
using System;
using Xunit;
namespace member_spy
public class MemberTest
public void When_Member_Access_to_Profile() {
SpyAuthorize spy = new SpyAuthorize();
Member member1 = new Member(spy);
Member member2 = new Member(spy);
string is_authorized = member1.Profile();
Assert.Equal(2, spy.checkAuthorizeWasCalled);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.