Example #1
0
        public void DataLoader_ConstructorParameterOfficerDataMapperNull_ReturnsException()
        {
            ICommonDataAccess fakeDataAccess = NSubstitute.Substitute.For <ICommonDataAccess>();

            IOfficerDataMapper fakeOfficerDataMapper = null;

            Assert.Throws <ArgumentNullException>(() => new DataLoader(fakeDataAccess, fakeOfficerDataMapper));
        }
Example #2
0
        public void DataLoader_ConstructorParametersAreNotNull_ReturnsDataLoader()
        {
            ICommonDataAccess fakeDataAccess = NSubstitute.Substitute.For <ICommonDataAccess>();

            IOfficerDataMapper fakeOfficerDataMapper = NSubstitute.Substitute.For <IOfficerDataMapper>();

            var dataLoader = new DataLoader(fakeDataAccess, fakeOfficerDataMapper);

            Assert.NotNull(dataLoader);
        }
Example #3
0
 public DataLoader(ICommonDataAccess dataAccess, IOfficerDataMapper mapper)
 {
     this.dataAccess = dataAccess ?? throw new ArgumentNullException(nameof(dataAccess));
     this.mapper     = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }