예제 #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);
        }
예제 #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);
        }
예제 #3
0
 public async Task CheckGracefulFailureForUnknownCars()
 {
     var inMemoryStorage = new InMemoryStorage();
     await CheckVignette.Run(new PlateRead { LicensePlate = "X" }, new DebugLogger(""), inMemoryStorage);
 }