Exemple #1
0
        public void CanWriteTest()
        {
            // arrange
            IPaletteSerializer target;
            bool actual;

            target = new JascPaletteSerializer();

            // act
            actual = target.CanWrite;

            // assert
            actual.Should().BeTrue();
        }
    public void CanWriteTest()
    {
      // arrange
      IPaletteSerializer target;
      bool actual;

      target = new JascPaletteSerializer();

      // act
      actual = target.CanWrite;

      // assert
      actual.Should().BeTrue();
    }
    public void GetSerializerTest()
    {
      // arrange
      IPaletteSerializer expected;
      IPaletteSerializer actual;
      string fileName;

      expected = new JascPaletteSerializer();
      fileName = "test." + expected.DefaultExtension;

      // act
      actual = PaletteSerializer.GetSerializer(fileName);

      // assert
      actual.Should().BeOfType<JascPaletteSerializer>();
    }
    public void DeserializeTest()
    {
      // arrange
      IPaletteSerializer target;
      string fileName;
      ColorCollection expected;
      ColorCollection actual;

      fileName = Path.Combine(this.DataPath, "db32.pal");

      target = new JascPaletteSerializer();

      expected = this.CreateDawnBringer32Palette(true);

      // act
      using (Stream stream = File.OpenRead(fileName))
        actual = target.Deserialize(stream);

      // assert
      CollectionAssert.AreEqual(expected, actual);
    }
    public void DeserializeTest()
    {
      // arrange
      IPaletteSerializer target;
      string fileName;
      ColorCollection expected;
      ColorCollection actual;

      fileName = Path.Combine(this.DataPath, "background.lbm");

      target = new InterleavedBitmapPaletteSerializer();

      expected = new JascPaletteSerializer().Deserialize(Path.Combine(this.DataPath, "background.pal"));

      // act
      using (Stream stream = File.OpenRead(fileName))
        actual = target.Deserialize(stream);

      // assert
      CollectionAssert.AreEqual(expected, actual);
    }
    public void SerializeTest()
    {
      // arrange
      IPaletteSerializer target;
      ColorCollection expected;
      ColorCollection actual;
      MemoryStream write;

      target = new JascPaletteSerializer();

      expected = this.CreateDawnBringer32Palette(false);
      write = new MemoryStream();

      // act
      target.Serialize(write, expected);

      using (MemoryStream read = new MemoryStream(write.ToArray()))
        actual = new JascPaletteSerializer().Deserialize(read);

      // assert
      CollectionAssert.AreEqual(expected, actual);
    }
        public void DeserializeTest()
        {
            // arrange
            IPaletteSerializer target;
            string             fileName;
            ColorCollection    expected;
            ColorCollection    actual;

            fileName = Path.Combine(this.DataPath, "background.lbm");

            target = new InterleavedBitmapPaletteSerializer();

            expected = new JascPaletteSerializer().Deserialize(Path.Combine(this.DataPath, "background.pal"));

            // act
            using (Stream stream = File.OpenRead(fileName))
            {
                actual = target.Deserialize(stream);
            }

            // assert
            CollectionAssert.AreEqual(expected, actual);
        }
Exemple #8
0
        public void DeserializeTest()
        {
            // arrange
            IPaletteSerializer target;
            string             fileName;
            ColorCollection    expected;
            ColorCollection    actual;

            fileName = Path.Combine(this.DataPath, "db32.pal");

            target = new JascPaletteSerializer();

            expected = this.CreateDawnBringer32Palette(true);

            // act
            using (Stream stream = File.OpenRead(fileName))
            {
                actual = target.Deserialize(stream);
            }

            // assert
            CollectionAssert.AreEqual(expected, actual);
        }
Exemple #9
0
        public void SerializeTest()
        {
            // arrange
            IPaletteSerializer target;
            ColorCollection    expected;
            ColorCollection    actual;
            MemoryStream       write;

            target = new JascPaletteSerializer();

            expected = this.CreateDawnBringer32Palette(false);
            write    = new MemoryStream();

            // act
            target.Serialize(write, expected);

            using (MemoryStream read = new MemoryStream(write.ToArray()))
            {
                actual = new JascPaletteSerializer().Deserialize(read);
            }

            // assert
            CollectionAssert.AreEqual(expected, actual);
        }