/// <summary> /// Saves as GBS. /// </summary> /// <param name="toSave">the Coat of Arms To save.</param> /// <param name="filePath">The file path.</param> /// <param name="checkFormat">if set to <c>true</c> [check format].</param> /// <exception cref="UnauthorizedAccessException">If the file exist and is not writable</exception> /// <exception cref="InvalidOperationException">if a serialization error occur</exception> public void SaveAsGbs(CoatOfArms toSave, String filePath, bool checkFormat = true) { //TODO @Grathad : managing the XSD to check on the format. var shell = new GbsFormat {XmlCoatOfArms = toSave}; var fileStream = PrepareFileStream(filePath, FileMode.Create); Serialize(shell, ref fileStream); fileStream.Close(); }
public CoatOfArms ShapeTest() { var target = new CoatOfArms { Shape = new Shape { Geometry = "M 0,0 L 100,0 100,100 0,100 Z", Identifier = Guid.NewGuid(), TypeOfResource = ResourceType.Custom, Name = "Test" } }; Assert.IsNotNull(target, "Unable to construct a coat of arms with a custom shape"); return target; }
public void CoatOfArmsConstructorTest() { var target = new CoatOfArms(); //Version 0.9.0 no particular comportment on the constructor side Assert.IsNotNull(target, "Unable to construct a coat of armss"); }