public void MapResponseToRequest() { var mapper = new ApiRetweetModelMapper(); var model = new ApiRetweetResponseModel(); model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("0"), 1); ApiRetweetRequestModel response = mapper.MapResponseToRequest(model); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.RetwitterUserId.Should().Be(1); response.Time.Should().Be(TimeSpan.Parse("0")); response.TweetTweetId.Should().Be(1); }
public async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiRetweetResponseModel model = await client.RetweetGetAsync(1); ApiRetweetModelMapper mapper = new ApiRetweetModelMapper(); UpdateResponse <ApiRetweetResponseModel> updateResponse = await client.RetweetUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }