Пример #1
0
 public void CreateTestStory(Story story)
 {
     try
     {
         _repository.Add(story);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex.Message);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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());
        }