public void DataLoader_ConstructorParameterOfficerDataMapperNull_ReturnsException() { ICommonDataAccess fakeDataAccess = NSubstitute.Substitute.For <ICommonDataAccess>(); IOfficerDataMapper fakeOfficerDataMapper = null; Assert.Throws <ArgumentNullException>(() => new DataLoader(fakeDataAccess, fakeOfficerDataMapper)); }
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); }
public DataLoader(ICommonDataAccess dataAccess, IOfficerDataMapper mapper) { this.dataAccess = dataAccess ?? throw new ArgumentNullException(nameof(dataAccess)); this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }