Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public void Setup()
 {
     PrincipalMock = new Mock <IPrincipal>();
     Rule          = new CanRequestRule(PrincipalMock.Object, null);
 }