Exemplo n.º 1
0
        public void PopulateMappingGrid()
        {
            var entityLogicalName = "Acoount";
            var entityRef         = new EntityReference(entityLogicalName);

            var mapping = new Item <EntityReference, EntityReference>(entityRef, entityRef);

            mappings.Add(mapping);

            using (var systemUnderTest = new MappingList(mappings))
            {
                FluentActions.Invoking(() => systemUnderTest.PopulateMappingGrid())
                .Should()
                .NotThrow();
            }
        }
Exemplo n.º 2
0
        public void GetMappingListPopulatedEntityLogicalName()
        {
            var entityLogicalName = "Acoount";
            var entityRef         = new EntityReference(entityLogicalName);

            var mapping = new Item <EntityReference, EntityReference>(entityRef, entityRef);

            mappings.Add(mapping);

            using (var systemUnderTest = new MappingList(mappings))
            {
                systemUnderTest.PopulateMappingGrid();

                var actual = systemUnderTest.GetMappingList(entityLogicalName);

                actual.Count.Should().Be(1);
            }
        }
Exemplo n.º 3
0
        public void GetGuidMappingList()
        {
            var totalEntityReferences = 5;

            for (int i = 0; i < totalEntityReferences; i++)
            {
                var entityRef = new EntityReference($"TestEntity{i}", Guid.NewGuid());
                var mapping   = new Item <EntityReference, EntityReference>(entityRef, entityRef);
                mappings.Add(mapping);
            }

            using (var systemUnderTest = new MappingList(mappings))
            {
                systemUnderTest.PopulateMappingGrid();

                var actual = systemUnderTest.GetGuidMappingList();

                actual.Count.Should().Be(totalEntityReferences);
            }
        }
Exemplo n.º 4
0
        public void PerformMappingsCellValidationFormatedValueIsNotAGuidForIdColumn()
        {
            for (int i = 0; i < 5; i++)
            {
                var entityRef = new EntityReference($"TestEntity{i}", Guid.NewGuid());
                var mapping   = new Item <EntityReference, EntityReference>(entityRef, entityRef);
                mappings.Add(mapping);
            }

            var column = $"Id";

            using (var systemUnderTest = new MappingList(mappings))
            {
                systemUnderTest.PopulateMappingGrid();

                var actual = systemUnderTest.PerformMappingsCellValidation(column, "fjkghfjk", 3, 0);

                actual.Should().BeTrue();
            }
        }
Exemplo n.º 5
0
        public void PerformMappingsCellValidationFormatedValueIsNotNullForClEntityColumn()
        {
            for (int i = 0; i < 5; i++)
            {
                var entityRef = new EntityReference($"TestEntity{i}", Guid.NewGuid());
                var mapping   = new Item <EntityReference, EntityReference>(entityRef, entityRef);
                mappings.Add(mapping);
            }

            var column     = $"clEntity";
            var entityRef1 = new EntityReference($"clEntity", Guid.NewGuid());

            mappings.Add(new Item <EntityReference, EntityReference>(entityRef1, entityRef1));

            using (var systemUnderTest = new MappingList(mappings))
            {
                systemUnderTest.PopulateMappingGrid();

                var actual = systemUnderTest.PerformMappingsCellValidation(column, entityRef1.Id, 6, 0);

                actual.Should().BeFalse();
            }
        }