public void DefineDataSourceReturnsTheSameDataSourceIfAlreadyDefined()
        {
            DataSourceTable table = new DataSourceTable();
            DataSource source = table.DefineDataSource("source");

            Assert.AreSame(source, table.DefineDataSource("source"));
        }
        public void ResolveDataSourceReturnsADataSource()
        {
            DataSourceTable table = new DataSourceTable();

            DataSource source1 = table.DefineDataSource("source1");
            Assert.IsNotNull(source1);

            DataSource source2 = table.DefineDataSource("source2");
            Assert.IsNotNull(source2);

            Assert.AreSame(source1, table.ResolveDataSource("source1"));
            Assert.AreSame(source2, table.ResolveDataSource("source2"));
        }
        public void ResolveDataSourceReturnsNullIfTheDataSourceIsNotDefinedButOthersAre()
        {
            DataSourceTable table = new DataSourceTable();
            table.DefineDataSource("someOtherSource");

            Assert.IsNull(table.ResolveDataSource("test"));
        }
 public void DefineDataSourceThrowsIfNameIsNull()
 {
     DataSourceTable table = new DataSourceTable();
     table.DefineDataSource(null);
 }