public void Put_UpdateExistingMatchFixture() { var matchFixtureDto = new UpdateMatchFixtureRequest { Guid = Guid.NewGuid() }; var matchFixture = new MatchFixture(); _mapper.Expect(m => m.Map <UpdateMatchFixtureRequest, MatchFixture>(matchFixtureDto)).Return(matchFixture); _matchFixtureService.Expect(s => s.Save(matchFixture)).Return(matchFixtureDto.Guid); var result = _controller.Put(matchFixtureDto); Assert.AreEqual(ResponseStatus.Success, result.Status); Assert.AreEqual(matchFixtureDto.Guid, result.Guid); }
public void Put_UpdateExistingMatchFixture() { var matchFixtureDto = new UpdateMatchFixtureRequest { Guid = Guid.NewGuid() }; var matchFixture = new MatchFixture(); //var newUri = string.Format("http://localhost:8080/MatchFixture/{0}", matchFixtureDto.Guid); _mapper.Expect(m => m.Map <UpdateMatchFixtureRequest, MatchFixture>(matchFixtureDto)).Return(matchFixture); _matchFixtureService.Expect(s => s.Save(matchFixture)).Return(matchFixtureDto.Guid); HttpResponseMessage result = _controller.Put(matchFixtureDto); Assert.AreEqual(HttpStatusCode.NoContent, result.StatusCode); // TODO: Test newly added resource URI. //Assert.AreEqual(newUri, result.Headers.Location); }