Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
.Net Core 2 Spy Test
using System;
using Xunit;
namespace member_spy
{
public class MemberTest
{
[Fact]
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