public void CreateTestStory(Story story) { try { _repository.Add(story); } catch (Exception ex) { _logger.LogError(ex.Message); } }
public void Add_And_Presist_Changes_Should_Succeed() { using (BeginTransaction()) { var story = CreateNewStory(); _storyRepository.Add(story); Assert.Equal(EntityState.Added, story.EntityState); _database.SubmitChanges(); Assert.Equal(EntityState.Unchanged, story.EntityState); } }
public Story Post([FromBody] Story story) { story.ProjectId = SessionUser.ActiveProject; return(_storyRepository.Add(story)); }
public void Add_Should_Use_Database() { database.Setup(d => d.Insert(It.IsAny <Story>())).Verifiable(); _storyRepository.Add(CreateStory()); }