public void IsLoginOK_WithNonExistingUser_CallLogger(string username, string password, string expectedMessage)
        {
            FakeLogger    stubLogger    = new FakeLogger();
            LoginManager1 loginManager1 = new LoginManager1(stubLogger);

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

            Assert.AreEqual(expectedMessage, stubLogger.Written);
        }
Exemple #2
0
        public void IsLoginOK_InvalidUser_LogUserAndPassword()
        {
            var           mockLogger = new FakeLogger();
            LoginManager1 lm         = new LoginManager1(mockLogger, new FakeWebService());

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

            StringAssert.Contains("bad login: a,pass", mockLogger.GetLastWrite());
        }
Exemple #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());
        }