Ejemplo n.º 1
0
        public void ReadXElement_Empty_ThrowsSyncDocumentException()
        {
            TestDatabaseDataProvider provider = new TestDatabaseDataProvider();

            XElement element = XElement.Parse("<NotGenericProvider />");
            provider.ReadXElement(element);
        }
Ejemplo n.º 2
0
        public void ReadXElement_SetQuery_ReturnsCorrectQuery()
        {
            TestDatabaseDataProvider provider = new TestDatabaseDataProvider();

            provider.ReadXElement(XElement.Parse(@"
<IDataProvider>
    <GenericProvider connectionString=""connectionString"" query=""select * from data"" />
</IDataProvider>"));

            Assert.IsTrue(provider.Query == "select * from data");
        }
Ejemplo n.º 3
0
        public void GetXElement_SetConnectionString_ReturnsCorrectXml()
        {
            TestDatabaseDataProvider provider = new TestDatabaseDataProvider();
            provider.ConnectionString = "connectionString";
            provider.Query = "select * from data";

            var element = provider.GetXElement();

            var attribute = element.Attribute(DatabaseDataProvider.CN_CONNECTION_STRING);

            Assert.IsNotNull(attribute);
            Assert.IsTrue(attribute.Value == "connectionString");
        }
 public void ReadXElement_Empty_ThrowsArgumentNullException()
 {
     TestDatabaseDataProvider provider = new TestDatabaseDataProvider();
     XElement element = null;
     provider.ReadXElement(element);
 }
Ejemplo n.º 5
0
        public void TestDatabaseDataProvider_Empty_HasSerializer()
        {
            TestDatabaseDataProvider provider = new TestDatabaseDataProvider();

            Assert.IsNotNull(provider.Serializer);
        }