Ejemplo n.º 1
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());
        }
Ejemplo n.º 2
0
        public void IsLoginOK_LogWriteFails_SendExceptionToWebService()
        {
            var stubLogger     = new FakeLogger();
            var mockWebservice = new FakeWebService();

            stubLogger.WillWriteFail = true;
            var loggingManager = CreateLoggingManager(stubLogger, mockWebservice);

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

            StringAssert.Contains("got exception - Write faild", mockWebservice.GetLastPostMessage());
        }
Ejemplo n.º 3
0
 private static LoginManager1 CreateLoggingManager(FakeLogger stubLogger, FakeWebService mockWebservice)
 {
     return(new LoginManager1(stubLogger, mockWebservice));
 }