Beispiel #1
0
        public void Serializer_Exists()
        {
            // ARRANGE
            var builder = new XsrcEntityBuilder(@"Rulebase\Inputs.xsrc");

            // ACT
            var xsrcInput = builder.Deserialize();

            // ASSERT
            xsrcInput.Should().NotBeNull();
        }
Beispiel #2
0
        public void XSRCEntityBuilder_GlobalAttributes_Exist()
        {
            // ARRANGE
            var builder = new XsrcEntityBuilder(@"Rulebase\Inputs.xsrc");

            // ACT
            var model  = builder.Deserialize();
            var global = builder.GlobalEntity(model);

            // ASSERT
            global.GlobalEntity.Attributes.Select(a => a.PublicName).Should().NotBeNullOrEmpty();
        }
Beispiel #3
0
        public void XSRCEntityBuilder_Child_Exists()
        {
            // ARRANGE
            var builder = new XsrcEntityBuilder(@"Rulebase\Inputs.xsrc");

            // ACT
            var model = builder.Deserialize();
            var child = builder.GetChildren("global", model);

            // ASSERT
            child.Should().NotBeNull();
        }
Beispiel #4
0
        public void Serializer_Correct()
        {
            // ARRANGE
            var builder = new XsrcEntityBuilder(@"Rulebase\Inputs.xsrc");

            // ACT
            var xsrcInput = builder.Deserialize();

            // ASSERT
            xsrcInput.RootEntities.Where(g => g.@Ref == "global").Select(n => n.@Ref).Should().BeEquivalentTo("global");
            xsrcInput.RootEntities.Select(n => n.Id).Should().BeEquivalentTo(EntityIDs());
        }
Beispiel #5
0
        public void XSRCEntityBuilder_ChildAttributes_Exist()
        {
            // ARRANGE
            var builder = new XsrcEntityBuilder(@"Rulebase\Inputs.xsrc");

            // ACT
            var model = builder.Deserialize();
            var child = builder.GetChildren("global", model);

            // ASSERT
            child.Select(p => p.Attributes.Select(a => a.PublicName)).Should().NotBeNullOrEmpty();
        }
Beispiel #6
0
        public void XSRCEntityBuilder_Child_Correct()
        {
            // ARRANGE
            var builder = new XsrcEntityBuilder(@"Rulebase\Inputs.xsrc");

            // ACT
            var model = builder.Deserialize();
            var child = builder.GetChildren("global", model);

            // ASSERT
            child.Select(p => p.Name).Should().BeEquivalentTo("customer");
            child.Select(c => c.Children.Count()).Should().BeEquivalentTo(1);
        }
Beispiel #7
0
        public void XSRCEntityBuilder_Global_Correct()
        {
            // ARRANGE
            var builder = new XsrcEntityBuilder(@"Rulebase\Inputs.xsrc");

            // ACT
            var model  = builder.Deserialize();
            var global = builder.GlobalEntity(model);

            // ASSERT
            global.GlobalEntity.PublicName.Should().BeEquivalentTo("global");
            global.GlobalEntity.Children.Count().Should().Be(1);
        }
Beispiel #8
0
        public void XSRCEntityBuilder_GlobalAttributes_Correct()
        {
            // ARRANGE
            var builder = new XsrcEntityBuilder(@"Rulebase\Inputs.xsrc");

            // ACT
            var model  = builder.Deserialize();
            var global = builder.GlobalEntity(model);

            // ASSERT
            var attrobutes = global.GlobalEntity.Attributes.Select(a => a.PublicName).ToList();

            attrobutes.Select(a => a).Should().BeEquivalentTo("Version");
        }
Beispiel #9
0
        public void XSRCEntityBuilder_ChildAttributes_CountCorrect()
        {
            // ARRANGE
            var builder = new XsrcEntityBuilder(@"Rulebase\Inputs.xsrc");

            // ACT
            var model = builder.Deserialize();
            var child = builder.GetChildren("global", model);

            // ASSERT
            var attributes = child.SelectMany(p => p.Attributes.Select(a => a.PublicName)).ToList();

            attributes.Count.Should().Be(5);
        }