public void FirstTest() { LoginManager1 lm = new LoginManager1(); lm.AddUser("a", "pass"); //? }
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); }
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()); }