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>()); }
public async Task <Result> Create(int projectId, [FromBody] CreateDataCollectorRequestDto createDataCollectorDto) => await _dataCollectorService.Create(projectId, createDataCollectorDto);