Exemplo n.º 1
0
        public void LoadSchemaFileWithValidPath()
        {
            string configFilename = "TestData\\testschemafile.xml";

            var entityLogicalName = "account";
            var entityMetadata    = new EntityMetadata
            {
                LogicalName = entityLogicalName,
                DisplayName = new Label
                {
                    UserLocalizedLabel = new LocalizedLabel {
                        Label = "Test"
                    }
                }
            };

            InsertAttributeList(entityMetadata, new List <string> {
                "contactattnoentity1"
            });

            var inputEntityAttributes = new Dictionary <string, HashSet <string> >();

            workingstate = true;

            using (var systemUnderTest = new SchemaWizard())
            {
                systemUnderTest.OrganizationService = ServiceMock.Object;
                systemUnderTest.MetadataService     = MetadataServiceMock.Object;
                systemUnderTest.NotificationService = NotificationServiceMock.Object;

                FluentActions.Invoking(() => systemUnderTest.LoadSchemaFile(configFilename, workingstate, NotificationServiceMock.Object, inputEntityAttributes, inputEntityRelationships))
                .Should()
                .NotThrow();
            }
        }
Exemplo n.º 2
0
        public void LoadSchemaFileWithEmptyExportConfigPath()
        {
            string schemaFilename        = string.Empty;
            var    inputEntityAttributes = new Dictionary <string, HashSet <string> >();

            NotificationServiceMock.Setup(x => x.DisplayFeedback(It.IsAny <string>()))
            .Verifiable();

            using (var systemUnderTest = new SchemaWizard())
            {
                systemUnderTest.OrganizationService = ServiceMock.Object;
                systemUnderTest.MetadataService     = MetadataServiceMock.Object;
                systemUnderTest.NotificationService = NotificationServiceMock.Object;

                FluentActions.Invoking(() => systemUnderTest.LoadSchemaFile(schemaFilename, workingstate, NotificationServiceMock.Object, inputEntityAttributes, inputEntityRelationships))
                .Should()
                .NotThrow();
            }

            NotificationServiceMock.Verify(x => x.DisplayFeedback(It.IsAny <string>()), Times.Never);
        }