Exemplo n.º 1
0
        public void UnionGeneratesCorrectDescription()
        {
            TSParameter firstParameter  = new TSParameter("Name", "Type", "The description");
            TSParameter secondParameter = new TSParameter("Name", "Type", "Some other Description");
            TSParameter thirdParameter  = new TSParameter("Name", "Type", "Third description");

            TSParameter union = TSParameter.Union(firstParameter, secondParameter, thirdParameter);

            Assert.AreEqual("The description or some other Description or third description", union.Description);
        }
Exemplo n.º 2
0
        public void UnionGeneratesCorrectType()
        {
            TSParameter firstParameter  = new TSParameter("Name", "Type", "description");
            TSParameter secondParameter = new TSParameter("Name", "OtherType", "description");
            TSParameter thirdParameter  = new TSParameter("Name", "Type", "description");

            TSParameter union = TSParameter.Union(firstParameter, secondParameter, thirdParameter);

            Assert.AreEqual("Type | OtherType", union.Type);
        }
Exemplo n.º 3
0
        public void UnionGeneratesCorrectName()
        {
            TSParameter firstParameter  = new TSParameter("Name", "Type", "description");
            TSParameter secondParameter = new TSParameter("otherName", "Type", "description");
            TSParameter thirdParameter  = new TSParameter("moreComplicatedName", "Type", "description");

            TSParameter union = TSParameter.Union(firstParameter, secondParameter, thirdParameter);

            Assert.AreEqual("nameOrOtherNameOrMoreComplicatedName", union.Name);
        }
Exemplo n.º 4
0
 public void UnionThrowsIfOneElementPassed()
 {
     Assert.ThrowsException <ArgumentException>(() => TSParameter.Union(new TSParameter("name", "type", "description")));
 }
Exemplo n.º 5
0
 public void UnionThrowsIfNoElementsPassed()
 {
     Assert.ThrowsException <ArgumentException>(() => TSParameter.Union(new TSParameter[] { }));
 }
Exemplo n.º 6
0
 public static TSParameter Union(params TSParameter[] parameters)
 {
     return(TSParameter.Union(parameters, null, null, null, null));
 }