public void should_GetTableList() { StorageType type = StorageType.EventProcessState; // Designated storage provider this.Given(f => f.GivenInitStorageFactory(new StorageOptions(providerName, ""))) .When(f => f.WhenGetTableList(name, type, name)) .Then(f => f.ThenListCount(tableNames, new List <string>() { StorageTableNameBuild.BuildTableName(name, type) })) .BDDfy(); //Use the hair sharding service List <string> tables = new List <string>() { "test1", "test2", "test3", "test4", "test5", "test6", }; IList <string> tables1 = tables.Select(f => StorageTableNameBuild.BuildTableName(f, type)).ToList(); storageSharding.Setup(f => f.GetTableList(name, type, name, null)).Returns(() => { return(Task.FromResult(tables)); }); this.Given(f => f.GivenInitStorageFactory(new StorageOptions(null, providerName))) .When(f => f.WhenGetTableList(name, type, name)) .Then(f => f.ThenListCount(tableNames, tables1)) .BDDfy(); }
public void should_GetTable() { StorageType type = StorageType.EventSource; string table1 = StorageTableNameBuild.BuildTableName(name, type); // Designated storage provider this.Given(f => f.GivenInitStorageFactory(new StorageOptions(providerName, ""))) .When(f => f.WhenGetTable(name, type, name)) .Then(f => f.Then <string>(table1, this.tableName)) .BDDfy(); //Use the hair sharding service storageSharding.Setup(f => f.GetTable(name, type, name)).Returns(Task.FromResult(name)); this.Given(f => f.GivenInitStorageFactory(new StorageOptions(null, providerName))) .When(f => f.WhenGetTable(name, type, name)) .Then(f => f.Then <string>(table1, this.tableName)) .BDDfy(); }