public void ArchiveThrowTest() { //Assert.NotThrows IConfiguration config = new ConfigurationBuilder().AddInMemoryCollection(new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("startYear", currentYear.ToString()), }).Build(); ArchiveReader reader = new ArchiveReader(settings, YearMock(currentYear)); //Assert.Throws reader.GetYears(); IAppSettings failSettings = Mock.Of <IAppSettings>(mock => mock.StartYear == currentYear + 1 ); ArchiveReader failReader = new ArchiveReader(failSettings, YearMock(currentYear)); Assert.Throws <ArgumentOutOfRangeException>(failReader.GetYears); }
public void ArchiveRangeTest() { ArchiveReader reader = new ArchiveReader(settings, YearMock(currentYear)); Assert.Equal(new int[] { 2010, 2011, 2013, 2014, 2016, 2017 }, reader.GetYears()); }