Пример #1
0
        public async Task UpdateKundeTest()
        {
            Kunde customer = await _target.Get(1);

            customer.Vorname = "Hansruedi";

            await _target.Update(customer);

            customer = await _target.Get(1);

            Xunit.Assert.Equal("Hansruedi", customer.Vorname);
        }
Пример #2
0
        public async Task UpdateKundeTest()
        {
            // arrange
            Kunde kunde = await _target.Get(1);

            kunde.Nachname     = "Tanner";
            kunde.Vorname      = "Julia";
            kunde.Geburtsdatum = new DateTime(1996, 10, 04);

            // act
            await _target.Update(kunde);

            // assert
            kunde = await _target.Get(1);

            Assert.Equal(1, kunde.Id);
            Assert.Equal("Tanner", kunde.Nachname);
            Assert.Equal("Julia", kunde.Vorname);
            Assert.Equal(new DateTime(1996, 10, 04), kunde.Geburtsdatum);
        }
Пример #3
0
        public override async Task <KundeDto> Get(KundeRequest request, ServerCallContext context)
        {
            KundeManager manager  = new KundeManager();
            Kunde        customer = await manager.Get(request.Id);

            if (customer == null)
            {
                throw new RpcException(new Status(
                                           StatusCode.OutOfRange, "Id couldn't be found."
                                           ));
            }
            return(customer.ConvertToDto());
        }
Пример #4
0
        public override async Task <KundeDto> Get(KundeRequest request, ServerCallContext context)
        {
            Kunde result = await ClientManager.Get(request.Id);

            if (result == null)
            {
                throw new RpcException(new Status(
                                           StatusCode.OutOfRange,
                                           "Client not found"
                                           ));
            }
            return(result.ConvertToDto());
        }
 public KundeDto GetKunde(int id)
 {
     WriteActualMethod();
     return(_kundeManager.Get(id).ConvertToDto());
 }