示例#1
0
        public void TestSaveDevice_IMEI_13845257385757011()
        {
            string imei     = "13845257385757011";
            string deviceSn = "000010052";

            var newGeoPointDto = new GeoPointDto
            {
                Id         = Guid.NewGuid().ToString(),
                Imei       = imei,
                DeviceSn   = deviceSn,
                Latitude   = 13.7253520,
                Longitude  = 100.5794770,
                HeaderTime = DateTime.UtcNow,
                CreateDate = DateTime.Now,
            };

            var locations = reader.GetLocationsByImei(imei, new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 1), new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59));
            var count1    = locations.ToList().Count;

            writer.SaveGeoPointDto(newGeoPointDto);
            locations = reader.GetLocationsByImei(imei, new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 1), new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59));
            var count2 = locations.ToList().Count;

            var ge = count2 > count1;

            ge.Should().Equals(true);
        }
        public void CheckCount_GetLocationsByImei()
        {
            var locations = mongoGeolocations.GetLocationsByImei("13845257385757011", new DateTime(2012, 9, 10, 0, 0, 1), new DateTime(2012, 9, 10, 23, 59, 59));
            var count     = locations.ToList().Count;

            count.Should().Not.Equal(0);
        }
示例#3
0
        public void TestWithMockery()
        {
            var geopointList = mocksGeolocations.GetLocationsByImei("", DateTime.Now, DateTime.Now);

            geopointList.ToList().ForEach(g =>
            {
                Console.WriteLine("{0}|{1}|{2}", g.Imei, g.Latitude, g.Longitude);
            });
        }