コード例 #1
0
        public void FailShouldCreateFailedResult()
        {
            // Act
            var actual = ValueCalculationResult.Fail <int>();

            // Assert
            Assert.NotNull(actual);
            Assert.False(actual.Success);
        }
コード例 #2
0
        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> >());
            }
        }
コード例 #3
0
        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> >());
            }
        }