Пример #1
0
        public void LoginFailure()
        {
            var validator = new JiraConnectionValidator {
                JiraConnector = ConnectorMock, Logger = LoggerMock
            };

            Expect.Call(ConnectorMock.Login).Throw(new JiraLoginException());

            Repository.ReplayAll();
            var result = validator.Validate();

            Repository.VerifyAll();
            Assert.IsFalse(result, "Connection is not valid.");
        }
Пример #2
0
        public void ValidConnection()
        {
            var validator = new JiraConnectionValidator {
                JiraConnector = ConnectorMock, Logger = LoggerMock
            };

            Expect.Call(ConnectorMock.Login);
            Expect.Call(ConnectorMock.Logout);

            Repository.ReplayAll();
            var result = validator.Validate();

            Repository.VerifyAll();
            Assert.IsTrue(result, "Connection is not valid.");
        }