public void Test() { var discussion = new Discussion { Id = Guid.NewGuid(), Title = "Text!" }; discussionsRepository.Create(discussion); var actual = discussionsRepository.Read(discussion.Id); Assert.AreEqual(discussion.Title, actual.Title); }
private bool TryConvertDiscussionModelToDiscussion(DiscussionModel discussionModel, out Discussion discussion) { discussion = null; Guid id; if (!Guid.TryParse(discussionModel.Id, out id)) return false; discussion = new Discussion { Id = id, Title = discussionModel.Title, State = int.Parse(discussionModel.State) }; return true; }