コード例 #1
0
        public void TestCorrectLogin()
        {
            // Setup
            IUsersService          service = new UsersServiceFake();
            IAuthenticationManager manager = AuthenticationManager.GetInstance(service);

            // Action
            manager.Login("123", "123456");

            // Assertion
            Assert.IsTrue(manager.IsAuthenticated());
        }
コード例 #2
0
        public void TestFaildLogin()
        {
            // Setup
            IUsersService          service = new UsersServiceFake();
            IAuthenticationManager manager = AuthenticationManager.GetInstance(service);

            // Action
            manager.Login("*****@*****.**", "123");

            // Assertion
            Assert.IsFalse(manager.IsAuthenticated());
        }
 public UsersControllerTests()
 {
     _service    = new UsersServiceFake();
     _controller = new UsersController(_service);
 }