Exemplo n.º 1
0
        public async Task RecognizeMissingVignette()
        {
            var inMemoryStorage = new InMemoryStorage();
            var car             = new Car {
                LicensePlate = "X"
            };
            await inMemoryStorage.CreateCarAsync(car);

            await CheckVignette.Run(new PlateRead { LicensePlate = "X" }, new DebugLogger(""), inMemoryStorage);

            Assert.NotEmpty(car.Violations);
        }
Exemplo n.º 2
0
        public async Task DetectValidVignette()
        {
            var inMemoryStorage = new InMemoryStorage();
            var car             = new Car
            {
                LicensePlate = "X",
                Vignettes    = new List <Vignette>
                {
                    new Vignette
                    {
                        From  = DateTime.UtcNow.AddMinutes(-5).Ticks,
                        Until = DateTime.UtcNow.AddMinutes(5).Ticks
                    }
                }
            };
            await inMemoryStorage.CreateCarAsync(car);

            await CheckVignette.Run(
                new PlateRead { LicensePlate = "X", ReadTimestamp = DateTime.UtcNow.Ticks },
                new DebugLogger(""),
                inMemoryStorage);

            Assert.Empty(car.Violations);
        }
Exemplo n.º 3
0
 public async Task CheckGracefulFailureForUnknownCars()
 {
     var inMemoryStorage = new InMemoryStorage();
     await CheckVignette.Run(new PlateRead { LicensePlate = "X" }, new DebugLogger(""), inMemoryStorage);
 }