public void BeginShouldReturnCorrectResult() { IoC.Initialize(IoCTest.GetIDependencyResolverMock()); IUnitOfWork unitOfWork = UnitOfWorkManager.Begin(); Assert.IsNotNull(unitOfWork); }
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>(); }
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()); }
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()); }