public void DynamicVisibleValidationMethod_MapLineDataWithMapTheme_ReturnsExpectedValuesForRelevantProperties(bool hasMapTheme) { // Setup MapLineData mapLineData = hasMapTheme ? new MapLineData("Test", new LineStyle(), CreateMapTheme()) : new MapLineData("Test"); var properties = new MapLineDataProperties(mapLineData, Enumerable.Empty <MapDataCollection>()); // Call bool isCategoryThemesVisible = properties.DynamicVisibleValidationMethod( nameof(MapLineDataProperties.CategoryThemes)); bool isLineColorStyleVisible = properties.DynamicVisibleValidationMethod( nameof(MapLineDataProperties.Color)); bool isLineWidthVisible = properties.DynamicVisibleValidationMethod( nameof(MapLineDataProperties.Color)); bool isLineDashStyleVisible = properties.DynamicVisibleValidationMethod( nameof(MapLineDataProperties.Color)); // Assert Assert.AreEqual(hasMapTheme, isCategoryThemesVisible); Assert.AreNotEqual(hasMapTheme, isLineColorStyleVisible); Assert.AreNotEqual(hasMapTheme, isLineWidthVisible); Assert.AreNotEqual(hasMapTheme, isLineDashStyleVisible); }
public void DynamicVisibleValidationMethod_ShowLabels_ReturnsExpectedValuesForRelevantProperties(bool showLabels) { // Setup var mapLineData = new MapLineData("Test") { ShowLabels = showLabels }; var properties = new MapLineDataProperties(mapLineData, Enumerable.Empty <MapDataCollection>()); // Call bool isSelectedMetaDataAttributeVisible = properties.DynamicVisibleValidationMethod( nameof(MapLineDataProperties.SelectedMetaDataAttribute)); // Assert Assert.AreEqual(showLabels, isSelectedMetaDataAttributeVisible); }
public void DynamicVisibleValidationMethod_AnyOtherProperty_ReturnsTrue() { // Setup var mapLineData = new MapLineData("Test", new LineStyle(), CreateMapTheme()) { Features = new[] { new MapFeature(Enumerable.Empty <MapGeometry>()) }, ShowLabels = true }; var properties = new MapLineDataProperties(mapLineData, Enumerable.Empty <MapDataCollection>()); // Call bool isOtherPropertyVisible = properties.DynamicVisibleValidationMethod(string.Empty); // Assert Assert.IsFalse(isOtherPropertyVisible); }