public void Can_Generate_Api_Xml()
        {
            //Arrange
            var expected = new XElement("StructureAttribute",
                                        new XAttribute("id", "46"),
                                        new XAttribute("name", "bar"),
                                        new XElement("StructureValue",
                                                     new XAttribute("langId", "10"),
                                                     new XAttribute("scope", "global"),
                                                     new XCData("foo")));

            var value = new StructureValue {
                LanguageId = 10, Value = "foo"
            };
            var attr = new StructureAttribute {
                DefinitionId = 46, Name = "bar", Values = new List <StructureValue> {
                    value
                }
            };

            //Act
            var actual = attr.ToAdsml();

            //Assert
            Assert.That(actual, Is.Not.Null);
            Assert.That(actual.ToString(), Is.EqualTo(expected.ToString()));
        }
        public void ToApiXml_Throws_ASVE_If_DefinitionId_And_Name_Are_Not_Set()
        {
            //Arrange
            var attr = new StructureAttribute();

            //Act
            attr.ToAdsml();
        }
        public void Can_Generate_Api_Xml_Without_Specifying_Value()
        {
            //Arrange
            var expected = new XElement("StructureAttribute",
                                        new XAttribute("name", "foo"));

            var attr = new StructureAttribute {
                Name = "foo"
            };

            //Act
            var actual = attr.ToAdsml();

            //Assert
            Assert.That(actual, Is.Not.Null);
            Assert.That(actual.ToString(), Is.EqualTo(expected.ToString()));
        }