Пример #1
0
 public void NewsTypesTest()
 {
     // get test
     Assert.That(NewsTypes.Post.ToString(), Is.EqualTo("post"));
     Assert.That(NewsTypes.Photo.ToString(), Is.EqualTo("photo"));
     Assert.That(NewsTypes.PhotoTag.ToString(), Is.EqualTo("photo_tag"));
     Assert.That(NewsTypes.WallPhoto.ToString(), Is.EqualTo("wall_photo"));
     Assert.That(NewsTypes.Friend.ToString(), Is.EqualTo("friend"));
     Assert.That(NewsTypes.Note.ToString(), Is.EqualTo("note"));
     // parse test
     Assert.That(NewsTypes.FromJsonString("post"), Is.EqualTo(NewsTypes.Post));
     Assert.That(NewsTypes.FromJsonString("photo"), Is.EqualTo(NewsTypes.Photo));
     Assert.That(NewsTypes.FromJsonString("photo_tag"), Is.EqualTo(NewsTypes.PhotoTag));
     Assert.That(NewsTypes.FromJsonString("wall_photo"), Is.EqualTo(NewsTypes.WallPhoto));
     Assert.That(NewsTypes.FromJsonString("friend"), Is.EqualTo(NewsTypes.Friend));
     Assert.That(NewsTypes.FromJsonString("note"), Is.EqualTo(NewsTypes.Note));
 }
Пример #2
0
        public void NewsTypesTest()
        {
            // get test
            Assert.That(actual: NewsTypes.Post.ToString(), expression: Is.EqualTo(expected: "post"));
            Assert.That(actual: NewsTypes.Photo.ToString(), expression: Is.EqualTo(expected: "photo"));
            Assert.That(actual: NewsTypes.PhotoTag.ToString(), expression: Is.EqualTo(expected: "photo_tag"));
            Assert.That(actual: NewsTypes.WallPhoto.ToString(), expression: Is.EqualTo(expected: "wall_photo"));
            Assert.That(actual: NewsTypes.Friend.ToString(), expression: Is.EqualTo(expected: "friend"));
            Assert.That(actual: NewsTypes.Note.ToString(), expression: Is.EqualTo(expected: "note"));

            // parse test
            Assert.That(actual: NewsTypes.FromJsonString(response: "post"), expression: Is.EqualTo(expected: NewsTypes.Post));
            Assert.That(actual: NewsTypes.FromJsonString(response: "photo"), expression: Is.EqualTo(expected: NewsTypes.Photo));
            Assert.That(actual: NewsTypes.FromJsonString(response: "photo_tag"), expression: Is.EqualTo(expected: NewsTypes.PhotoTag));
            Assert.That(actual: NewsTypes.FromJsonString(response: "wall_photo"), expression: Is.EqualTo(expected: NewsTypes.WallPhoto));
            Assert.That(actual: NewsTypes.FromJsonString(response: "friend"), expression: Is.EqualTo(expected: NewsTypes.Friend));
            Assert.That(actual: NewsTypes.FromJsonString(response: "note"), expression: Is.EqualTo(expected: NewsTypes.Note));
        }