public void GetMetadataTest() { IURLParametersParser parser = null; Statistics target = new Statistics(parser, serviceImplementation); int sourceid = 1; int indicatorid = 1; IndicatorMetadata expected = metadata; IndicatorMetadata actual = target.GetMetadata(sourceid, indicatorid); Assert.AreEqual(expected, actual); }
public void StatisticsConstructorTest() { IURLParametersParser parser = null; IStatisticsProxyService service = null; Statistics target = new Statistics(parser, service); Assert.AreNotEqual(null, target); }
public void GetDataSerieTest() { var mock = new Mock<IURLParametersParser>(); mock.Setup(m => m.ParseDimensionFilterList(It.IsAny<string>())).Returns(new List<DimensionFilter>()); mock.Setup(m => m.ParseDimensionFilter(It.IsAny<string>())).Returns(new DimensionFilter()); IURLParametersParser parser = mock.Object; Statistics target = new Statistics(parser, serviceImplementation); int sourceid = 1; int indicatorid = 1; string axisDimension = "1,1,2"; string selectedDimensions = "1,1,2#2,1,2"; IndicatorValues expected = new IndicatorValues { Values = values }; IndicatorValues actual = target.GetIndicatorValues(sourceid, indicatorid, axisDimension, selectedDimensions); Assert.AreEqual(expected, actual); mock.Verify(m => m.ParseDimensionFilterList(selectedDimensions)); mock.Verify(m => m.ParseDimensionFilterList(axisDimension)); }