Exemplo n.º 1
0
        public void FirstTest()
        {
            LoginManager1 lm = new LoginManager1();

            lm.AddUser("a", "pass");
            //?
        }
Exemplo n.º 2
0
        public void IsLoginOK_WithExistingUser_CallLogger(string username, string password, string expectedMessage)
        {
            FakeLogger    stubLogger    = new FakeLogger();
            LoginManager1 loginManager1 = new LoginManager1(stubLogger);

            loginManager1.AddUser(username, password);

            bool logingResult = loginManager1.IsLoginOK(username, password);

            Assert.AreEqual(expectedMessage, stubLogger.Written);
        }
Exemplo n.º 3
0
        public void IsLoginOK_ValidUser_LogUser()
        {
            var           mockLogger = new FakeLogger();
            LoginManager1 lm         = new LoginManager1(mockLogger, new FakeWebService());

            lm.AddUser("a", "pass");

            lm.IsLoginOK("a", "pass");

            StringAssert.Contains("login ok: user: a", mockLogger.GetLastWrite());
        }