Beispiel #1
0
        public void Serialize_Deserialize_Works()
        {
            // Arrange,
            var expected = SampleObjects.EnemyPatrol;
            var target   = new PatrolsSerializer();

            // Act,
            var record = target.Deserialize(new ObservableCollection <EnemyPatrol> {
                expected
            });
            var actual = target.Serialize(record);

            // Assert,
            Assert.AreEqual(expected, actual[0]);
        }
Beispiel #2
0
        public void Serialize_Works()
        {
            // Arrange,
            var text     = SampleStrings.GetRecordString(SampleStrings.PatrolsString);
            var tokens   = text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            var expected = SampleObjects.EnemyPatrol;
            var record   = TokenParser.ParseTokens(tokens).GetRecord(PatrolsSerializer.Patrols);
            var target   = new PatrolsSerializer();

            // Act,
            var actual = target.Serialize(record);

            // Assert,
            Assert.AreEqual(expected, actual[0]);
        }