Пример #1
0
        public void DiskDriveEnumerableDeserializeFromJSON(DiskDriveEnumerableTestData inTestData)
        {
            foreach (var e in inTestData.E)
            {
                var obj = Fixture.Serializer.Deserialize <IEnumerable <IDiskDrive> >(e.SerializedTestData);
                obj.Should().BeOfType(typeof(IEnumerable <IDiskDrive>));
                Fixture.Serializer.Deserialize <IEnumerable <IDiskDrive> >(e.SerializedTestData).Should().BeEquivalentTo(e.ObjTestData);
            }

            // ToDo loop over every element of the enumerable and test eah one
        }
Пример #2
0
        public void DiskDriveEnumerableSerializeToJSON(DiskDriveEnumerableTestData inTestData)
        {
#if DEBUG
            TestOutput.WriteLine("Starting " + nameof(DiskDriveEnumerableSerializeToJSON));
#endif
            foreach (var e in inTestData.E)
            {
#if DEBUG
                TestOutput.WriteLine("SerializedTestData is:" + e.SerializedTestData);
                TestOutput.WriteLine("Serialized ObjTestData is:" + Fixture.Serializer.Serialize(e.ObjTestData));
#endif
                Fixture.Serializer.Serialize(e.ObjTestData).Should().Be(e.SerializedTestData);
#if DEBUG
                TestOutput.WriteLine("Ending " + nameof(DiskDriveEnumerableSerializeToJSON));
#endif
            }
        }