예제 #1
0
        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));
        }
예제 #2
0
        public void ReportGeneratorConstructor_AllConstructorParameterNull_ReturnsException()
        {
            IDataLoader fakeDataLoader = null;
            IOfficerViewModelDataMapper fakeOfficerViewModel = null;
            IOutputFormatter            fakeOutputFormatter  = null;

            Assert.Throws <ArgumentNullException>(() => new ReportGenerator(fakeDataLoader, fakeOfficerViewModel, fakeOutputFormatter));
        }
예제 #3
0
 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));
 }