public void Update() { Conference result = new Conference(); ConferenceModel updated; DateTime newDate = new DateTime(2016, 2, 2); ConferenceModel conference = new ConferenceModel { ProfileId = 1, Location = "TestLocation", Date = new DateTime(2016, 1, 1), Content = "TestContet", Title = "TestTitle" }; result = repo.SearchConference(conference).FirstOrDefault(); if (result != null) { result.Location = "UpdateLocation"; result.Content = "UpdateContent"; result.Title = "UpdateTitle"; result.Date = newDate; updated = repo.ConvertToModel(result); repo.UpdateConference(updated); result = repo.SearchConference(updated).FirstOrDefault(); Assert.IsTrue(result.Location == "UpdateLocation"); Assert.IsTrue(result.Content == "UpdateContent"); Assert.IsTrue(result.Title == "UpdateTitle"); Assert.IsTrue(result.Date == newDate); } }