private static void AssertMatch(string definitionPath, string requestPath,
			string firstMatchHashKey, BbcMusicRequest expectedRequest)
		{
			var restPath = new RestPath(typeof(BbcMusicRequest), definitionPath);

			var reqestTestPath = RestPath.GetPathPartsForMatching(requestPath);
			Assert.That(restPath.IsMatch("GET", reqestTestPath), Is.True);

			Assert.That(firstMatchHashKey, Is.EqualTo(restPath.FirstMatchHashKey));

			var actualRequest = restPath.CreateRequest(requestPath) as BbcMusicRequest;

			Assert.That(actualRequest, Is.Not.Null);
			Assert.That(actualRequest.mbz_guid, Is.EqualTo(expectedRequest.mbz_guid));
			Assert.That(actualRequest.release_type, Is.EqualTo(expectedRequest.release_type));
			Assert.That(actualRequest.content_type, Is.EqualTo(expectedRequest.content_type));
		}
Esempio n. 2
0
        private static void AssertMatch(string definitionPath, string requestPath,
                                        string firstMatchHashKey, BbcMusicRequest expectedRequest)
        {
            var restPath = new RestPath(typeof(BbcMusicRequest), definitionPath);

            var reqestTestPath = RestPath.GetPathPartsForMatching(requestPath);

            Assert.That(restPath.IsMatch("GET", reqestTestPath), Is.True);

            Assert.That(firstMatchHashKey, Is.EqualTo(restPath.FirstMatchHashKey));

            var actualRequest = restPath.CreateRequest(requestPath) as BbcMusicRequest;

            Assert.That(actualRequest, Is.Not.Null);
            Assert.That(actualRequest.mbz_guid, Is.EqualTo(expectedRequest.mbz_guid));
            Assert.That(actualRequest.release_type, Is.EqualTo(expectedRequest.release_type));
            Assert.That(actualRequest.content_type, Is.EqualTo(expectedRequest.content_type));
        }