Example #1
0
        public void TestThatConstructorInitializeFoodWasteSystemDataCommandHandler()
        {
            var systemDataRepositoryMock  = MockRepository.GenerateMock <ISystemDataRepository>();
            var foodWasteObjectMapperMock = MockRepository.GenerateMock <IFoodWasteObjectMapper>();
            var specificationMock         = MockRepository.GenerateMock <ISpecification>();
            var commonValidationsMock     = MockRepository.GenerateMock <ICommonValidations>();
            var exceptionBuilderMock      = MockRepository.GenerateMock <IExceptionBuilder>();

            var systemDataCommandHandlerBase = new MyFoodWasteSystemDataCommandHandler(systemDataRepositoryMock, foodWasteObjectMapperMock, specificationMock, commonValidationsMock, exceptionBuilderMock);

            Assert.That(systemDataCommandHandlerBase, Is.Not.Null);
            Assert.That(systemDataCommandHandlerBase.GetSystemDataRepository(), Is.Not.Null);
            Assert.That(systemDataCommandHandlerBase.GetSystemDataRepository(), Is.EqualTo(systemDataRepositoryMock));
            Assert.That(systemDataCommandHandlerBase.GetObjectMapper(), Is.Not.Null);
            Assert.That(systemDataCommandHandlerBase.GetObjectMapper(), Is.EqualTo(foodWasteObjectMapperMock));
            Assert.That(systemDataCommandHandlerBase.GetSpecification(), Is.Not.Null);
            Assert.That(systemDataCommandHandlerBase.GetSpecification(), Is.EqualTo(specificationMock));
            Assert.That(systemDataCommandHandlerBase.GetCommonValidations(), Is.Not.Null);
            Assert.That(systemDataCommandHandlerBase.GetCommonValidations(), Is.EqualTo(commonValidationsMock));
            Assert.That(systemDataCommandHandlerBase.GetExceptionBuilder(), Is.Not.Null);
            Assert.That(systemDataCommandHandlerBase.GetExceptionBuilder(), Is.EqualTo(exceptionBuilderMock));
        }