public void ReportGeneratorConstructor_ConstructorParameterOfficerViewModelNull_ReturnsException() { var fakeDataLoader = NSubstitute.Substitute.For <IDataLoader>(); IOfficerViewModelDataMapper fakeOfficerViewModel = null; var fakeOutputFormatter = NSubstitute.Substitute.For <IOutputFormatter>(); Assert.Throws <ArgumentNullException>(() => new ReportGenerator(fakeDataLoader, fakeOfficerViewModel, fakeOutputFormatter)); }
public void ReportGeneratorConstructor_AllConstructorParameterNull_ReturnsException() { IDataLoader fakeDataLoader = null; IOfficerViewModelDataMapper fakeOfficerViewModel = null; IOutputFormatter fakeOutputFormatter = null; Assert.Throws <ArgumentNullException>(() => new ReportGenerator(fakeDataLoader, fakeOfficerViewModel, fakeOutputFormatter)); }
public ReportGenerator(DataLoader.IDataLoader dataLoader, IOfficerViewModelDataMapper officerViewModelLoader, IOutputFormatter outputFormatter) { this.dataLoader = dataLoader ?? throw new ArgumentNullException(nameof(dataLoader)); this.officerViewModelLoader = officerViewModelLoader ?? throw new ArgumentNullException(nameof(officerViewModelLoader)); this.outputFormatter = outputFormatter ?? throw new ArgumentNullException(nameof(outputFormatter)); }