Exemplo n.º 1
0
        public async Task GetAutoByIdTest()
        {
            var result = await _target.GetByIdAsync(new GetAutoByIdRequest { Id = 1 });

            Assert.Equal(1, result.Id);
            Assert.Equal("Fiat Punto", result.Marke);
            Assert.Equal(50, result.Tagestarif);
            Assert.Equal(AutoKlasse.Standard, result.AutoKlasse);
        }
Exemplo 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);
        }