public async Task Get_Should_Return_Profile() { var response = await Client.GetAsync("/api/Profile/1"); response.EnsureSuccessStatusCode(); var content = await response.Content.ReadAsStringAsync(); var profile = JsonConvert.DeserializeObject <Profile>(content); AuditableTest.EnsureNotModifiedAuditableEntity(profile); AuditableTest.EqualsIgnoreAuditableProps(profile, Utilities.GetTestProfile()); }
public async Task Post_Should_Create_Profile() { var postObj = new Profile { Id = 2, Email = "*****@*****.**", FirstName = "Julius2", LastName = "Koronci2", PhoneNumber = "0767654430", WebSite = "www.web-solutions.sk" }; var response = await Client.PostAsync("/api/profile", new StringContent(JsonConvert.SerializeObject(postObj), Encoding.UTF8) { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }); response.EnsureSuccessStatusCode(); var profile = JsonConvert.DeserializeObject <Profile>(await response.Content.ReadAsStringAsync()); AuditableTest.EnsureNotModifiedAuditableEntity(profile); AuditableTest.EqualsIgnoreAuditableProps(profile, postObj); }