public void TestExternalServiceTennisJson()
        {
            //Test that passing a typed fixture to a service that deals with the base class only still keps all the typed information intact (integration test)
            
            //Arrange
            var fixture = new TennisFixture
                              {
                                  Sport = Fixture.SportTennis,
                                  Description = "Tennis 01",
                                  Variables = new TennisVariables
                                                  {
                                                      NumberOfSets = 3,
                                                      LongFinalSet = false
                                                  }
                              };
            const string fixtureCreateUrl = ExternalServiceUrl + "fixture";
            var fixtureJson = fixture.ToJson();

            //Act
            var jsonResponse = RestHelper.GetJsonResponse(new Uri(fixtureCreateUrl), fixtureJson, "POST", Fixture.ContentTypeTennis);

            //Assert
            Assert.AreEqual("{\"Variables\":{\"NumberOfSets\":3,\"LongFinalSet\":false},\"Sport\":\"Tennis\",\"Description\":\"Tennis 01\"}", fixtureJson);
            Assert.AreEqual("{\"Variables\":{\"NumberOfSets\":3,\"LongFinalSet\":false},\"Sport\":\"Tennis\",\"Description\":\"Tennis 01\"}", jsonResponse);
        }
        public void TestTennisJson()
        {
            //Tests that serializing a typed fixture works

            //Arrange
            var fixture = new TennisFixture
            {
                Sport = Fixture.SportTennis,
                Description = "Tennis 01",
                Variables = new TennisVariables
                {
                    NumberOfSets = 3,
                    LongFinalSet = false
                }
            };
            
            //Act
            var fixtureJson = fixture.ToJson();

            //Assert
            Assert.AreEqual("{\"Variables\":{\"NumberOfSets\":3,\"LongFinalSet\":false},\"Sport\":\"Tennis\",\"Description\":\"Tennis 01\"}", fixtureJson);
        }
        public void TestContentTypeDeserializationTennis()
        {
            //Test that deserializing a sub class into a base class type works when you specify a content type
            
            //Arrange
            var fixture = new TennisFixture
            {
                Sport = Fixture.SportTennis,
                Description = "Tennis 01",
                Variables = new TennisVariables
                {
                    NumberOfSets = 3,
                    LongFinalSet = false
                }
            };

            //Act
            var fixtureJson = fixture.ToJson();
            var deserializedFixture = fixtureJson.FromJson<Fixture>(Fixture.ContentTypeTennis);

            //Assert
            Assert.AreEqual("{\"Variables\":{\"NumberOfSets\":3,\"LongFinalSet\":false},\"Sport\":\"Tennis\",\"Description\":\"Tennis 01\"}", fixtureJson);
            Assert.AreEqual(typeof(TennisFixture), deserializedFixture.GetType());
            Assert.AreEqual(typeof(TennisVariables), ((TennisFixture)deserializedFixture).Variables.GetType());
            Assert.AreEqual(Fixture.SportTennis, deserializedFixture.Sport);
            Assert.AreEqual("Tennis 01", deserializedFixture.Description);
            Assert.AreEqual(3, ((TennisFixture)deserializedFixture).Variables.NumberOfSets);
            Assert.IsFalse(((TennisFixture)deserializedFixture).Variables.LongFinalSet);
        }