コード例 #1
0
        public void ExcludeSchemaTypes_ShouldDeselectTheSpecifiedTypes()
        {
            var objectSelection = new SchemaTypesViewModel
            {
                SchemaTypes = new List <SchemaTypeModel>
                {
                    new SchemaTypeModel {
                        ShortName = "Type1", Name = "Test.Type1", IsSelected = true
                    },
                    new SchemaTypeModel {
                        ShortName = "Type2", Name = "Test.Type2", IsSelected = true
                    },
                    new SchemaTypeModel {
                        ShortName = "Type3", Name = "Test.Type3", IsSelected = false
                    },
                    new SchemaTypeModel {
                        ShortName = "Type4", Name = "Test.Type4", IsSelected = true
                    }
                }
            };

            objectSelection.ExcludeSchemaTypes(new string[] { "Test.Type1", "Test.Type3", "Test.Type4" });

            objectSelection.SchemaTypes.ShouldBeEquivalentTo(new List <SchemaTypeModel>()
            {
                new SchemaTypeModel {
                    ShortName = "Type1", Name = "Test.Type1", IsSelected = false
                },
                new SchemaTypeModel {
                    ShortName = "Type2", Name = "Test.Type2", IsSelected = true
                },
                new SchemaTypeModel {
                    ShortName = "Type3", Name = "Test.Type3", IsSelected = false
                },
                new SchemaTypeModel {
                    ShortName = "Type4", Name = "Test.Type4", IsSelected = false
                }
            });
        }
コード例 #2
0
        public void ExcludeSchemaTypes_ShouldDeselectTheSpecifiedTypesWithSpecifiedBoundOperations()
        {
            using (var objectSelection = new SchemaTypesViewModel
            {
                SchemaTypes = new List <SchemaTypeModel>
                {
                    new SchemaTypeModel
                    {
                        ShortName = "Type1",
                        Name = "Test.Type1",
                        IsSelected = true,
                        BoundOperations = new List <BoundOperationModel>
                        {
                            new BoundOperationModel
                            {
                                IsSelected = true,
                                Name = "BoundOperation1(Type1)"
                            }
                        }
                    },
                    new SchemaTypeModel {
                        ShortName = "Type2", Name = "Test.Type2", IsSelected = true
                    },
                    new SchemaTypeModel {
                        ShortName = "Type3", Name = "Test.Type3", IsSelected = false
                    },
                    new SchemaTypeModel {
                        ShortName = "Type4", Name = "Test.Type4", IsSelected = true
                    }
                }
            })
            {
                objectSelection.ExcludeSchemaTypes(new string[] { "Test.Type1", "Test.Type3", "Test.Type4" }, new string[] { "BoundOperation1(Type1)" });

                objectSelection.SchemaTypes.ShouldBeEquivalentTo(new List <SchemaTypeModel>()
                {
                    new SchemaTypeModel
                    {
                        ShortName       = "Type1",
                        Name            = "Test.Type1",
                        IsSelected      = false,
                        BoundOperations = new List <BoundOperationModel>
                        {
                            new BoundOperationModel
                            {
                                IsSelected = false,
                                Name       = "BoundOperation1(Type1)"
                            }
                        }
                    },
                    new SchemaTypeModel {
                        ShortName = "Type2", Name = "Test.Type2", IsSelected = true
                    },
                    new SchemaTypeModel {
                        ShortName = "Type3", Name = "Test.Type3", IsSelected = false
                    },
                    new SchemaTypeModel {
                        ShortName = "Type4", Name = "Test.Type4", IsSelected = false
                    }
                });
            }
        }