public void Process_DummyQueryWithExtension_Expects42()
 {
     //Arrange
     var dummy = new DummyQuery();
     //Act
     var result = dummy.Process();
     //Assert
     Assert.AreEqual(42, result);
 }
 public void Process_DummyQuery_Expects42()
 {
     //Arrange
     var dummy = new DummyQuery();
     //Act
     var result = new QueryAndCommandProcessor().Process(dummy);
     //Assert
     Assert.AreEqual(42,result);
 }
        public IQuery PrepareQuery(object data)
        {
            var Data = data as GPSDeviceSimulatorData;

            if (Data == null)
            {
                throw new Exception("Data passed was not of the required type");
            }

            var query = new DummyQuery("GPSTable", new string[] { "long", "lat" },
                                       new string[] { Data.GetPositionLong().ToString(), Data.GetPositionLat().ToString() });

            return(query);
        }
Exemple #4
0
        /// <summary>
        /// Берет информацию из дивайса как object. Переобразует ее в
        /// класс данных устройва и создает IQuery для соответственного класса связи с БД.
        /// </summary>
        /// <returns>The query.</returns>
        /// <param name="data">Data.</param>
        public IQuery PrepareQuery(object data)
        {
            var dummyData = data as DummyDeviceData;

            if (dummyData == null)
            {
                throw new Exception("Data passed was not of the required type");
            }

            var query = new DummyQuery("dummy_coordinates",
                                       new string[] { "x", "y", "x" },
                                       new string[] {
                dummyData.GetX().ToString(),
                dummyData.GetY().ToString(),
                dummyData.GetZ().ToString()
            });

            return(query);
        }
Exemple #5
0
        public IQuery PrepareQuery(object data)
        {
            var dummyData = data as Bitmap;

            if (dummyData == null)
            {
                throw new Exception("Data passed was not of the required type");
            }

            string fileName = num.ToString() + ".bmp";

            dummyData.Save(fileName);
            num++;

            var query = new DummyQuery("dummy_images",
                                       new string[] { "filename" },
                                       new string[] { fileName });

            return(query);
        }