Ejemplo n.º 1
0
 /// <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();
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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");
 }