public async Task RetrieveLicense() { // Arrange // Act var result = await sut.GetLicense(1); // Assert Assert.That(result.Success, Is.True); Assert.That(result.Message, Is.EqualTo("App Found")); Assert.That(result.License, Is.EqualTo(license)); }
public async Task NotRetrieveLicenseIfAppDoesNotExist() { // Arrange // Act var result = await sutAppRepoFailure.GetLicense(5); // Assert Assert.That(result.Success, Is.False); Assert.That(result.Message, Is.EqualTo("App not Found")); Assert.That(result.License, Is.Not.EqualTo(license)); }
public async Task <ActionResult> GetLicense(int id) { var result = await appsService.GetLicense(id); if (result.Success) { result.Message = ControllerMessages.StatusCode200(result.Message); return(Ok(result)); } else { result.Message = ControllerMessages.StatusCode404(result.Message); return(NotFound(result)); } }