예제 #1
0
        public async Task BucarestVerifyImportSqlLite()
        {
            try
            {
                var buc     = new LoadBucarestTaxis();
                var taxis   = buc.TaxisFromCSV();
                var taxisOK = taxis.Item1;

                var results = await buc.TaxiFromPlateSqliteAll();

                results.RemoveAll(it => string.IsNullOrWhiteSpace(it.NumberAutorization));
                taxisOK.RemoveAll(it => string.IsNullOrWhiteSpace(it.NumberAutorization));
                results.ShouldNotBeEmpty();
                taxisOK.ShouldNotBeEmpty();
                foreach (var res in results)
                {
                    res.ShouldNotBeNull();
                    var dataCSV = taxisOK.FindNumber(res.NumberAutorization);
                    dataCSV.ShouldNotBeNull("cannot find autorization :" + res.NumberAutorization);
                    dataCSV.NumberAutorization.ShouldEqual(res.NumberAutorization);

                    taxisOK.Remove(dataCSV);
                }
                ;
                taxisOK.Count.ShouldEqual(0, "not loaded sqlite:" + string.Join(",", taxisOK.Select(it => it.NumberAutorization)));
                results.Count.ShouldNotEqual(0);
            }
            catch (System.Exception ex)
            {
                System.Console.WriteLine("!!!!" + ex.Message);
                System.Console.WriteLine("!!!!" + ex.StackTrace);
                throw;
            }
        }
예제 #2
0
        public void BucarestAll()
        {
            var buc   = new LoadBucarestTaxis();
            var taxis = buc.TaxisFromCSV();

            taxis.ShouldNotBeNull();
            var errorLines = taxis.Item2;

            //only error should be header
            errorLines.Length.ShouldEqual(1, string.Join(Environment.NewLine, errorLines));


            var taxisOK = taxis.Item1;

            taxisOK.Count.ShouldBeGreaterThan(0);
            var valid = taxisOK.Where(it => it.State == LicenceState.Valid);

            valid.Any().ShouldBeTrue();
            valid.Select(it => it.CarLicensed.PlateNumber).ShouldContain("B30LOB");

            var notvalid = taxisOK.Where(it => it.State == LicenceState.NotValid);

            notvalid.Any().ShouldBeTrue();
            notvalid.Select(it => it.CarLicensed.PlateNumber).ShouldContain("B30FUV");

            var analyze = taxisOK.Where(it => it.State == LicenceState.ToBeAnalyzed);

            analyze.Any().ShouldBeTrue();
            analyze.Select(it => it.CarLicensed.PlateNumber).ShouldContain("B09PVA");

            taxisOK.Where(it => it.State == LicenceState.Unknown).Count().ShouldBeLessThan(100);
        }
예제 #3
0
        public async Task BucarestSampleDataNoCase()
        {
            var buc = new LoadBucarestTaxis();
            var aut = await buc.TaxiFromPlateSqlite("B30LOB");

            aut?.State.ShouldEqual(LicenceState.Valid);
            var aut1 = await buc.TaxiFromPlateSqlite("b30lob");

            aut?.State.ShouldEqual(LicenceState.Valid);
        }
예제 #4
0
        public void Bucarest()
        {
            var buc   = new LoadBucarestTaxis();
            var taxis = buc.TaxisFromCSV();

            taxis.ShouldNotBeNull();
            taxis.Item1.Count.ShouldBeGreaterThan(0);
            var errorLines = taxis.Item2;

            //only error should be header
            errorLines.Length.ShouldEqual(1, string.Join(Environment.NewLine, errorLines));
        }
예제 #5
0
        //internal static TaxiAutorizations BucarestTaxis;
        public static void Main(string[] args)
        {
            if (!File.Exists("taxis.sqlite3"))
            {
                var buc = new LoadBucarestTaxis();
                buc.DownloadDatabaseSqlLite().GetAwaiter().GetResult();
            }
            //var buc = new LoadBucarestTaxis();
            //BucarestTaxis = buc.TaxisFromCSV().Item1;



            BuildWebHost(args).Run();
        }
예제 #6
0
        public async Task BucarestSampleData()
        {
            var buc = new LoadBucarestTaxis();
            var aut = await buc.TaxiFromPlateSqlite("B30LOB");

            aut.State.ShouldEqual(LicenceState.Valid);
            aut = await buc.TaxiFromPlateSqlite("B30FUV");

            aut.State.ShouldEqual(LicenceState.NotValid);
            aut = await buc.TaxiFromPlateSqlite("B88RNG");

            aut.State.ShouldEqual(LicenceState.ToBeAnalyzed);
            aut = await buc.TaxiFromPlateSqlite("CJ23XYZ");

            aut.ShouldBeNull();
        }