Exemplo n.º 1
0
        public void BeginShouldReturnCorrectResult()
        {
            IoC.Initialize(IoCTest.GetIDependencyResolverMock());

            IUnitOfWork unitOfWork = UnitOfWorkManager.Begin();

            Assert.IsNotNull(unitOfWork);
        }
Exemplo n.º 2
0
        public AccountRepositoryTests()
        {
            var mapper = new IoCTest();

            //Contain
            _commandRepository = new Mock <ICommandRepository <Accounts> >();
            _queryRepository   = new Mock <IQueryRepository <Accounts> >();
            _sutCommand        = new Mock <IAccountCommand>();
            _sutQuery          = new Mock <IAccountQuery>();
        }
Exemplo n.º 3
0
        public void ErrorShouldReturnCorrectResult()
        {
            const string msg = "Error Message 1";

            IoC.Initialize(IoCTest.GetIDependencyResolverMock());
            int numOfLoggedMessagesBefore = LoggerMock.Messages.Count;

            Logger.Error(msg);
            int numOfLoggedMessagesAfter = LoggerMock.Messages.Count;

            Assert.AreEqual(numOfLoggedMessagesBefore + 1, numOfLoggedMessagesAfter);
            Assert.AreEqual(msg, LoggerMock.Messages.Last());
        }
Exemplo n.º 4
0
        public void ExceptionShouldReturnCorrectResult()
        {
            const string         msg = "Exception Message 1";
            ApplicationException applicationException = new ApplicationException(msg);

            IoC.Initialize(IoCTest.GetIDependencyResolverMock());
            int numOfLoggedMessagesBefore = LoggerMock.Messages.Count;

            Logger.Exception(applicationException);
            int numOfLoggedMessagesAfter = LoggerMock.Messages.Count;

            Assert.AreEqual(numOfLoggedMessagesBefore + 1, numOfLoggedMessagesAfter);
            Assert.AreEqual(msg, LoggerMock.Messages.Last());
        }