public void JsonToXmlConvert() { //Arrange var jsonFakeResponse = WebResponseBuilder.Create(null, request: new JsonFakeRequest(), translateResponse: new JsonToXmlTranslateResponse()); var jsonToXmlConverter = new JsonToXmlConvert(null, jsonFakeResponse); //Act jsonToXmlConverter.Download(); var xml = jsonToXmlConverter.Xml; //Assert Assert.Equal(JsonToXmlTranslateRespnseHelper.XmlElement, xml.OuterXml); }
public void CheckResponse() { //Arrange var fakeWebResponse = WebResponseBuilder.Create(null, request: new FakeRequest()); var filmDetails = new FilmDetails(null, fakeWebResponse); //Act filmDetails.Download(); var model = filmDetails.Details; //Assert Assert.Equal(CREATOR, model.Creator); Assert.Equal(DIRECTOR, model.Directior); Assert.Equal(DURATION, model.Duration); Assert.Equal(GENRE, model.Genre); Assert.Equal(RATING, model.Rating); Assert.Equal(TITLE, model.Title); }
public HtmlDocWebSite(IWebUri webUri, IWebResponse webResponse = null) { this.webUri = webUri; this.webResponse = webResponse ?? WebResponseBuilder.Create(webUri); }
public JsonToXmlConvert(string uri, IWebResponse webResponse = null) { this.webResponse = webResponse ?? WebResponseBuilder.Create(new WebUri(uri), translateResponse: new JsonToXmlTranslateResponse()); }