public void FailShouldCreateFailedResult() { // Act var actual = ValueCalculationResult.Fail <int>(); // Assert Assert.NotNull(actual); Assert.False(actual.Success); }
private async Task <IValueCalculationResult <IEnumerable <TfsRepository> > > FetchRepositoriesAsync(CancellationToken token) { try { var repositories = await _repository.FetchAvailableRepositories(AsRawData()); return(ValueCalculationResult.Success(repositories)); } catch (Exception) { return(ValueCalculationResult.Fail <IEnumerable <TfsRepository> >()); } }
private async Task <IValueCalculationResult <IEnumerable <TfsProject> > > FetchProjectsAsync(CancellationToken token) { try { var projects = await _project.FetchAvailableProjects(AsRawData()); return(ValueCalculationResult.Success(projects)); } catch (Exception) { return(ValueCalculationResult.Fail <IEnumerable <TfsProject> >()); } }