Ejemplo n.º 1
0
        public void TestAddAttributes_FluentAPI()
        {
            // Arrange
            string      interfaceName = "IInterface";
            SGInterface @interface    = new SGInterface(interfaceName);
            string      attr1Name     = "Attr1";
            string      attr2Name     = "Attr2";
            SGAttribute attr1         = new SGAttribute(attr1Name);
            SGAttribute attr2         = new SGAttribute(attr2Name);

            // Act
            @interface = @interface.WithAttributes(attr1, attr2);

            // Assert
            Assert.IsTrue(@interface.Attributes.ContainsAll(attr1, attr2));
        }
Ejemplo n.º 2
0
        public void TestAddAttributes_PropertyInitializer()
        {
            // Arrange
            string      interfaceName = "IInterface";
            string      attr1Name     = "Attr1";
            string      attr2Name     = "Attr2";
            SGAttribute attr1         = new SGAttribute(attr1Name);
            SGAttribute attr2         = new SGAttribute(attr2Name);

            // Act
            SGInterface @interface = new SGInterface(interfaceName)
            {
                Attributes =
                {
                    attr1,
                    attr2
                }
            };

            // Assert
            Assert.IsTrue(@interface.Attributes.ContainsAll(attr1, attr2));
        }