Пример #1
0
            public async Task GetAllAsyncWhenNoSolutionsReturnsEmptyCollection()
            {
                //Arrange
                var mockSolutionRepository = GetDefaultISolutionRepositoryInstance();
                var mockUnitOfWork         = GetDefaultIUnitOfWorkInstance();
                var solutionId             = 200;

                mockSolutionRepository.Setup(r => r.FindById(solutionId))
                .Returns(Task.FromResult <Solution>(null));

                var service = new SolutionService(mockSolutionRepository.Object, mockUnitOfWork.Object);
                //Act
                SolutionResponse result = await service.GetByIdAsync(solutionId);

                var message = result.Message;

                //Assert
                message.Should().Be("Solution not found");
            }
Пример #2
0
 public SubmittedSolution(int part, string solution, SolutionResponse response)
 {
     Part     = part;
     Solution = solution;
     Response = response;
 }
Пример #3
0
 private Task SolutionStatusChanged(SolutionResponse solutionResponse)
 {
     return(hubContext.Clients.User(solutionResponse.UserId)
            .UpdateSolutionStatus(solutionResponse));
 }
Пример #4
0
 public SubmittedSolution(params string[] stringData)
 {
     Part     = int.Parse(stringData[0]);
     Solution = stringData[1];
     Response = (SolutionResponse)int.Parse(stringData[2]);
 }