Esempio n. 1
0
        public void InitFilterWithListViewtag()
        {
            var entityLogicalName = "account";
            var entityMetadata    = new EntityMetadata
            {
                LogicalName = entityLogicalName,
                DisplayName = new Label
                {
                    UserLocalizedLabel = new LocalizedLabel {
                        Label = "Test"
                    }
                }
            };
            var settings = new Capgemini.Xrm.CdsDataMigratorLibrary.Core.Settings();

            using (var systemUnderTest = new SchemaWizard())
            {
                var entityitem = new System.Windows.Forms.ListViewItem
                {
                    Tag = entityMetadata
                };
                systemUnderTest.Settings = settings;

                systemUnderTest.OrganizationService = ServiceMock.Object;
                systemUnderTest.MetadataService     = MetadataServiceMock.Object;

                FluentActions.Invoking(() => systemUnderTest.InitFilter(entityitem))
                .Should()
                .NotThrow();
            }
        }
Esempio n. 2
0
        public void InitFilterWithListViewtagAndNoSettings()
        {
            var entityLogicalName = "account";
            var entityMetadata    = new EntityMetadata
            {
                LogicalName = entityLogicalName,
                DisplayName = new Label
                {
                    UserLocalizedLabel = new LocalizedLabel {
                        Label = "Test"
                    }
                }
            };

            using (var systemUnderTest = new SchemaWizard())
            {
                var entityitem = new System.Windows.Forms.ListViewItem
                {
                    Tag = entityMetadata
                };
                systemUnderTest.Settings = null;

                systemUnderTest.OrganizationService = ServiceMock.Object;
                systemUnderTest.MetadataService     = MetadataServiceMock.Object;

                FluentActions.Invoking(() => systemUnderTest.InitFilter(entityitem))
                .Should()
                .Throw <NullReferenceException>()
                .WithMessage("Object reference not set to an instance of an object.");
            }
        }
Esempio n. 3
0
        public void InitFilter()
        {
            using (var systemUnderTest = new SchemaWizard())
            {
                var entityitem = new System.Windows.Forms.ListViewItem();

                systemUnderTest.OrganizationService = ServiceMock.Object;
                systemUnderTest.MetadataService     = MetadataServiceMock.Object;

                FluentActions.Invoking(() => systemUnderTest.InitFilter(entityitem))
                .Should()
                .NotThrow();
            }
        }