public void Get_when_friendlyurl_and_categoryurl_is_not_found_return_null() { //arrange var sut = new DataSetSchemaService(_repositoryDataSetSchema, _dataSetSchemaDefinitionService, _repositoryDataSetDetail, _sqlTableUtility); //act var result = sut.Get("categoryurl", "friendlyurl"); //assert Assert.AreEqual(null, result); //cleanup }
public void Get_when_friendlyurl_is_found_return_datasetschema() { //arrange var schema1 = new DataSetSchema() { Id = 1, Title = "friendlyurl" }; _repositoryDataSetSchema.Add(schema1); var sut = new DataSetSchemaService(_repositoryDataSetSchema, _dataSetSchemaDefinitionService, _repositoryDataSetDetail, _sqlTableUtility); //act var result = sut.Get("friendlyurl"); //assert Assert.AreEqual(1, result.Id); //cleanup _repositoryDataSetSchema.Delete(schema1); }
public void Get_when_SchemaDefinition_is_not_null_return_definition_columns_ordered_by_DefaultDisplayWeight() { //arrange var ds = new DataSetSchema() { Title = "schemaname", Definition = new DataSetSchemaDefinition() { Columns = new List <DataSetSchemaColumn>() { new DataSetSchemaColumn() { Id = 30, DefaultDisplayWeight = 2 }, new DataSetSchemaColumn() { Id = 29, DefaultDisplayWeight = 0 }, new DataSetSchemaColumn() { Id = 33, DefaultDisplayWeight = 1 }, } } }; _repositoryDataSetSchema.Add(ds); var sut = new DataSetSchemaService(_repositoryDataSetSchema, _dataSetSchemaDefinitionService, _repositoryDataSetDetail, _sqlTableUtility); //act var result = sut.Get("schemaname"); //assert Assert.AreEqual(result.Definition.Columns[0].Id, 29); }