Esempio n. 1
0
        public void ReadXElement_NoProviderFields_ThrowsException()
        {
            SourceDescriptor descriptor = new SourceDescriptor();
            descriptor.ReadXElement(XElement.Parse(@"
<Source>  
  <IDataProvider>
    <SqlDataProvider connectionString=""connstr"" query=""query"" />
  </IDataProvider>
</Source>"));
        }
Esempio n. 2
0
        public void ReadXElement_NoIDataProvider_ThrowsException()
        {
            SourceDescriptor descriptor = new SourceDescriptor();
            descriptor.ReadXElement(XElement.Parse(@"
<Source>
  <ProviderFields>
    <ProviderField name=""fieldName1"" type=""System.Int32"" />
    <ProviderField name=""fieldName2"" type=""System.Int32"" />
  </ProviderFields> 
</Source>"));
        }
Esempio n. 3
0
        public void ReadXElement_SetTwoProviderFields_ProviderFieldsHas2Items()
        {
            SourceDescriptor descriptor = new SourceDescriptor();

            descriptor.ReadXElement(XElement.Parse(@"
<Source>
  <ProviderFields>
    <ProviderField name=""fieldName1"" type=""System.Int32"" />
    <ProviderField name=""fieldName2"" type=""System.Int32"" />
  </ProviderFields>
  <IDataProvider>
    <SqlDataProvider connectionString=""connstr"" query=""query"" />
  </IDataProvider>
</Source>"));

            Assert.IsTrue(descriptor.ProviderFields.Count == 2);
        }
Esempio n. 4
0
 public void ReadXElement_Empty_ThrowsSyncDocumentException()
 {
     SourceDescriptor sd = new SourceDescriptor();
     XElement element = XElement.Parse("<NotSourceDescriptor />");
     sd.ReadXElement(element);
 }
Esempio n. 5
0
 public void ReadXElement_Empty_ThrowsArgumentNullException()
 {
     SourceDescriptor sd = new SourceDescriptor();
     XElement element = null;
     sd.ReadXElement(element);
 }