Esempio n. 1
0
        public async Task GetKundeByIdTest()
        {
            var result = await _target.GetByIdAsync(new GetKundeByIdRequest { Id = 1 });

            Assert.Equal(1, result.Id);
            Assert.Equal("Anna", result.Vorname);
            Assert.Equal("Nass", result.Nachname);
        }
Esempio n. 2
0
        public async Task InsertReservationTest()
        {
            AutoDto autoDto = await _autoClient.GetByIdAsync(new GetAutoByIdRequest { Id = 1 });

            KundeDto kundeDto = await _kundeClient.GetByIdAsync(new GetKundeByIdRequest { Id = 1 });

            ReservationDto reservationDto = new ReservationDto
            {
                Von        = new DateTime(1807, 1, 11, 0, 0, 0, DateTimeKind.Utc).ToTimestamp(),
                Bis        = new DateTime(1807, 1, 14, 0, 0, 0, DateTimeKind.Utc).ToTimestamp(),
                RowVersion = Google.Protobuf.ByteString.CopyFromUtf8(""),
                Auto       = autoDto,
                Kunde      = kundeDto
            };
            ReservationDto reservation = await _target.InsertAsync(reservationDto);

            //ReservationDto reservationFromDb = await _target.GetByIdAsync(new GetReservationByIdRequest { Id = 5 });

            Assert.Equal(reservationDto.Auto, reservation.Auto);
            Assert.Equal(reservationDto.Kunde, reservation.Kunde);
            Assert.Equal(reservationDto.Von, reservation.Von);
            Assert.Equal(reservationDto.Bis, reservation.Bis);
        }