public void UpdateStoryShouldModifyValues() { // Arrange var dataList = this.GetMockDataList(); var repository = new StoryRepository(dataList); var expected = dataList[0]; expected.Name = "Updated Name"; expected.ProjectName = "Updated Project"; // Act var updatedActual = repository.Update(expected); var obtainedActual = repository.Single(story => story.Name == expected.Name && story.ProjectName == expected.ProjectName); // Assert Assert.IsNotNull(updatedActual); Assert.IsNotNull(obtainedActual); Assert.AreEqual(expected.Name, updatedActual.Name); Assert.AreEqual(expected.Name, obtainedActual.Name); Assert.AreEqual(expected.ProjectName, updatedActual.ProjectName); Assert.AreEqual(expected.ProjectName, obtainedActual.ProjectName); }
public Story Put([FromBody] Story story) { return(_storyRepository.Update(story)); }
public void UpdateNonExistentStoryShouldThrowException() { // Arrange var dataList = this.GetMockDataList(); var repository = new StoryRepository(dataList); var notExpected = new Story { Name = "Updated Name", ProjectName = "Updated Project" }; // Act repository.Update(notExpected); }