public async Task CareerPathSegmentServiceDeleteReturnsNullWhenSegmentNotDeleted() { // arrange Guid documentId = Guid.NewGuid(); var expectedResult = false; A.CallTo(() => FakeRepository.DeleteAsync(documentId)).Returns(HttpStatusCode.BadRequest); // act var result = await CurrentOpportunitiesSegmentService.DeleteAsync(documentId).ConfigureAwait(false); // assert A.CallTo(() => FakeRepository.DeleteAsync(documentId)).MustHaveHappenedOnceExactly(); A.Equals(result, expectedResult); }
public async Task CareerPathSegmentServiceDeleteReturnsFalseWhenMissingRepository() { // arrange Guid documentId = Guid.NewGuid(); var careerPathSegmentModel = A.Fake <CurrentOpportunitiesSegmentModel>(); var expectedResult = false; A.CallTo(() => FakeRepository.DeleteAsync(documentId)).Returns(HttpStatusCode.FailedDependency); // act var result = await CurrentOpportunitiesSegmentService.DeleteAsync(documentId).ConfigureAwait(false); // assert A.CallTo(() => FakeRepository.DeleteAsync(documentId)).MustHaveHappenedOnceExactly(); A.Equals(result, expectedResult); }