Ejemplo n.º 1
0
        public async Task CreateDataCollector_WhenSuccess_ShouldReturnSuccess(DataCollectorType type, string displayName)
        {
            // Arrange
            var dataCollector = new CreateDataCollectorRequestDto
            {
                DataCollectorType = type,
                PhoneNumber       = "+4712344567",
                DisplayName       = displayName,
                SupervisorId      = SupervisorId,
                VillageId         = _nyssContextMock.Villages.ToList()[0].Id,
                Latitude          = 15,
                Longitude         = 45
            };

            // Act
            await _dataCollectorService.Create(ProjectId, dataCollector);

            // Assert
            await _nyssContextMock.Received(1).AddAsync(Arg.Any <DataCollector>());
        }
Ejemplo n.º 2
0
 public async Task <Result> Create(int projectId, [FromBody] CreateDataCollectorRequestDto createDataCollectorDto) =>
 await _dataCollectorService.Create(projectId, createDataCollectorDto);