public void LegendTextIsNotChangedWhenDataSetIsNotRealFile() { const string legendText = "Custom Legend Text"; var target = new ImageLayer { LegendText = legendText }; Assert.AreEqual(legendText, target.LegendText); var imageData = new ImageData {Filename = ""}; target.DataSet = imageData; // assign dataset // Legend should be same Assert.AreEqual(legendText, target.LegendText); }
public void LegendTextIsEqualsToFileNameWhenDataSetIsRealFile() { var target = new ImageLayer(); Assert.IsNull(target.LegendText); var imageData = new ImageData { Filename = Path.GetTempFileName(), }; target.DataSet = imageData; // Legend should be equals to filename Assert.AreEqual(Path.GetFileName(imageData.Filename), target.LegendText); }
/// <summary> /// Creates a new instance of a MapRasterLayer and the specified image data to use for rendering it. /// </summary> public MapRasterLayer(IRaster baseRaster, ImageData baseImage) : base(baseRaster) { base.LegendText = Path.GetFileNameWithoutExtension(baseRaster.Filename); BitmapGetter = baseImage; }