public void NameSimilarity_Content_Test() { _mockHttp.When(_testUrl + "name-similarity").Respond(HttpStatusCode.OK, "application/json", "{'response': 'OK'}"); Name name1 = new Name("Name One"); Name name2 = new Name("Name Two"); var response = _rosetteApi.NameSimilarity(name1, name2); # pragma warning disable 618 Assert.AreEqual(response.Content["response"], "OK"); # pragma warning restore 618 }
/// <summary>MatchedName /// <para> /// (POST)MatchedName Endpoint: Returns the result of matching 2 names. /// </para> /// </summary> /// <param name="n1">Name: First name to be matched</param> /// <param name="n2">Name: Second name to be matched</param> /// <returns>Dictionary<string, object>: Dictionary containing the results of the request. /// </returns> public Dictionary<string, object> MatchedName(Name n1, Name n2) { _uri = "matched-name/"; return getResponse(SetupClient(), new JavaScriptSerializer().Serialize(new Dictionary<string, object>(){ { "name1", n1}, { "name2", n2} })); }
public void NameClassTest() { Name name = new Name("text", "language", "script", "entityType"); Assert.AreEqual("text", name.text, "Name does not match"); Assert.AreEqual("language", name.language, "Language does not match"); Assert.AreEqual("script", name.script, "Script does not match"); Assert.AreEqual("entityType", name.entityType, "EntityType does not match"); }