Ejemplo n.º 1
0
        public void TestFileSerializationManagerGetFormatter()
        {
            var soapFormatter = new SoapFormatter();
            var manager       = new FileSerializationManager(soapFormatter, "test.bin");

            Assert.AreEqual(manager.Formatter, soapFormatter);
        }
Ejemplo n.º 2
0
        public void TestFileSerializationManagerSerializeDeserializeSimpleResult()
        {
            var manager = new FileSerializationManager(new BinaryFormatter(), "test.bin");
            var table   = new TopResults();

            table.Add(new SimpleResult(2, "player", new PlainResultFormatter()));
            table.Add(new SimpleResult(1, "player", new PlainResultFormatter()));
            manager.Serialize(table);
            var afterSerializationTable = manager.Deserialize();

            Assert.AreEqual(table.ToString(), afterSerializationTable.ToString());
        }
Ejemplo n.º 3
0
        public void TestFileSerializationManagerGetFileName()
        {
            var manager = new FileSerializationManager(new BinaryFormatter(), "test.bin");

            Assert.AreEqual(manager.FileName, "test.bin");
        }
Ejemplo n.º 4
0
 public void TestFileSerializationManagerConstructorCreateInstanceEmptyFileName()
 {
     var manager = new FileSerializationManager(new BinaryFormatter(), string.Empty);
 }
Ejemplo n.º 5
0
 public void TestFileSerializationManagerConstructorCreateInstanceNullFileName()
 {
     var manager = new FileSerializationManager(new BinaryFormatter(), null);
 }
Ejemplo n.º 6
0
 public void TestFileSerializationManagerConstructorCreateInstanceNullFormatter()
 {
     var manager = new FileSerializationManager(null, "test.bin");
 }
Ejemplo n.º 7
0
        public void TestFileSerializationManagerConstructorCreateInstance()
        {
            var manager = new FileSerializationManager(new BinaryFormatter(), "test.bin");

            Assert.IsInstanceOfType(manager, typeof(FileSerializationManager));
        }