Beispiel #1
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);
        }
Beispiel #2
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;
            }
        }
Beispiel #3
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));
        }