public async Task UpdateKundeTest() { // arrange String nachName = "Test Nachname"; int primaryKey = 1; Kunde kunde = _target.GetByPrimaryKey(primaryKey).Result; // act kunde.Nachname = nachName; await _target.UpdateEntity(kunde); // assert Kunde changedKunde = _target.GetByPrimaryKey(primaryKey).Result; Assert.True(changedKunde.Nachname == nachName); }
public override async Task <KundeDto> GetKunde(GetKundeRequest request, ServerCallContext context) { KundeDto response; try { response = await _manager.GetByPrimaryKey(request.IdFilter).ConvertToDto(); } catch (Exception) { throw new RpcException(new Status(StatusCode.Internal, "Internal error occured.")); } return(response ?? throw new RpcException(new Status(StatusCode.NotFound, "ID is invalid."))); }