public void Setup() { PrincipalMock = new Mock <IPrincipal>(); PrincipalMock.Setup(x => x.Identity.Name).Returns("abc"); UserManager = MockHelper.MockUserManager(_users); Rule = new CanRequestRule(PrincipalMock.Object, UserManager.Object); }
public void Setup() { PrincipalMock = new Mock <ICurrentUser>(); PrincipalMock.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { UserName = "******", NormalizedUserName = "******", Id = "a" }); UserManager = MockHelper.MockUserManager(_users); Rule = new CanRequestRule(PrincipalMock.Object, UserManager.Object); }
public void Setup() { PrincipalMock = new Mock <IPrincipal>(); Rule = new CanRequestRule(PrincipalMock.Object, null); }