예제 #1
0
        public void TestAddNullAttribute_ThrowsArgumentException()
        {
            // Arrange
            string      interfaceName = "IInterface";
            SGInterface @interface    = new SGInterface(interfaceName);

            // Act
            @interface = @interface.WithAttributes(null);
        }
예제 #2
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));
        }