예제 #1
0
        GetSchemaDefinitionV2_when_Schema_definitioncolumn_is_not_null_and_maxNumber_is_number_type_and_maxNumber_is_null_returns_col_na_in_restcolumndefinition
            ()
        {
            //arrange
            var mut = new DataShareService();
            //act
            var result = mut.GetSchemaDefinitionV2("categoryurl", "schemaurl_return_dsObj4");

            //Assert
            Assert.AreEqual("N/A", result.RestColumnDefinitions.ColumnDefinitions[3].MaxNumber);
        }
예제 #2
0
        GetSchemaDefinitionV2_when_Schema_definitioncolumn_linkeduri_is_null_sets_Uri_to_empty_string
            ()
        {
            //arrange
            var mut = new DataShareService();
            //act
            var result = mut.GetSchemaDefinitionV2("categoryurl", "schemaurl_return_dsObj4");

            //Assert
            Assert.AreEqual("", result.RestColumnDefinitions.ColumnDefinitions[3].Uri);
        }
예제 #3
0
        GetSchemaDefinitionV2_when_Schema_definitioncolumn_is_not_null_and_maxDate_is_datetime_type_and_maxdate_is_not_null_returns_col_maxdate_to_string_in_restcolumndefinition
            ()
        {
            //arrange
            var mut = new DataShareService();
            //act
            var result = mut.GetSchemaDefinitionV2("categoryurl", "schemaurl_return_dsObj3");

            //Assert
            Assert.AreEqual(new DateTime(2200, 1, 2).ToString(), result.RestColumnDefinitions.ColumnDefinitions[1].MaxDate);
        }
예제 #4
0
        GetSchemaDefinitionV2_when_Schema_definitioncolumn_is_not_null_and_maxCurrency_is_currency_type_and_maxCurrency_is_not_null_returns_col_maxCurrency_to_string_in_restcolumndefinition
            ()
        {
            //arrange
            var mut = new DataShareService();
            //act
            var result = mut.GetSchemaDefinitionV2("categoryurl", "schemaurl_return_dsObj3");

            //Assert
            Assert.AreEqual("100", result.RestColumnDefinitions.ColumnDefinitions[2].MaxCurrency);
        }
예제 #5
0
        GetSchemaDefinitionV2_when_Schema_definitioncolumn_is_not_null_and_maxsize_less_than_zero_returns_col_n_a_in_restcolumndefinition
            ()
        {
            //arrange
            var mut = new DataShareService();
            //act
            var result = mut.GetSchemaDefinitionV2("categoryurl", "schemaurl_return_dsObj4");

            //Assert
            Assert.AreEqual("N/A", result.RestColumnDefinitions.ColumnDefinitions[0].MaxSize);
        }
예제 #6
0
        public void GetSchemaDefinitionv2_when_schema_is_null_returns_Schema_rest_definition_Error_message_this_schema_does_not_exist()
        {
            //arrange
            var mut = new DataShareService();
            //act
            var result = mut.GetSchemaDefinitionV2("categoryurl", "schemaurl");

            //assert
            Assert.AreEqual("This schema does not exist!", result.ErrorMessage);
            //cleanup
        }
예제 #7
0
        public void GetSchemaDefinitionv2_when_schema_is_not_disabled_and_isOnline_and_Schema_DataSetSchemaDefinition_is_null_returns_schemarestdefinitionobject_type()
        {
            //arrange

            var mut = new DataShareService();
            //act
            var result = mut.GetSchemaDefinitionV2("categoryurl", "schemaurl_disabled_false_online_true");

            //assert
            Assert.AreEqual(typeof(SchemaRestDefinition), result.GetType());
            //cleanup
        }
예제 #8
0
        public void GetSchemaDefinitionv2_when_schema_is_disabled_returns_Schema_rest_definition_with_esdlinks_as_null()
        {
            //arrange

            var mut = new DataShareService();
            //act
            var result = mut.GetSchemaDefinitionV2("categoryurl", "schemaurl_disabled_true");

            //assert
            Assert.IsNull(result.EsdLinks);
            //cleanup
        }
예제 #9
0
        public void GetSchemaDefinitionv2_when_schema_is_disabled_returns_Schema_rest_definition_Error_message_this_schema_has_been_disabled()
        {
            //arrange

            var mut = new DataShareService();
            //act
            var result = mut.GetSchemaDefinitionV2("categoryurl", "schemaurl_disabled_true");

            //assert
            Assert.AreEqual("This schema has been disabled", result.ErrorMessage);
            //cleanup
        }