public void ReadXElement_NoProviderFields_ThrowsException() { SourceDescriptor descriptor = new SourceDescriptor(); descriptor.ReadXElement(XElement.Parse(@" <Source> <IDataProvider> <SqlDataProvider connectionString=""connstr"" query=""query"" /> </IDataProvider> </Source>")); }
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>")); }
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); }
public void ReadXElement_Empty_ThrowsSyncDocumentException() { SourceDescriptor sd = new SourceDescriptor(); XElement element = XElement.Parse("<NotSourceDescriptor />"); sd.ReadXElement(element); }
public void ReadXElement_Empty_ThrowsArgumentNullException() { SourceDescriptor sd = new SourceDescriptor(); XElement element = null; sd.ReadXElement(element); }