Пример #1
0
        public async Task ListDataCollector_WhenSuccessful_ShouldReturnSuccess()
        {
            // Act
            var result = await _dataCollectorService.List(ProjectId);

            // Assert
            result.IsSuccess.ShouldBeTrue();
            result.Value.Count().ShouldBe(2);
            var dataCollector = result.Value.First();

            dataCollector.Id.ShouldBe(DataCollectorWithoutReportsId);
            dataCollector.DisplayName.ShouldBe("");
            dataCollector.PhoneNumber.ShouldBe(DataCollectorPhoneNumber1);
            dataCollector.Village.ShouldBe(Village);
            dataCollector.District.ShouldBe("Layuna");
            dataCollector.Name.ShouldBe("");
            dataCollector.Sex.ShouldBe(Sex.Male);
            dataCollector.Region.ShouldBe("Layuna");

            var secondDataCollector = result.Value.Last();

            secondDataCollector.Id.ShouldBe(DataCollectorWithReportsId);
            secondDataCollector.Sex.ShouldBe(Sex.Female);
        }
Пример #2
0
 public async Task <Result <IEnumerable <DataCollectorResponseDto> > > List(int projectId) =>
 await _dataCollectorService.List(projectId);