Ejemplo n.º 1
0
        public void ReturnsIEnumerableWithSameValuesZeroTest()
        {
            var result = SmartFlagTestEnum.FromName("Zero, One").ToList();

            Assert.Equal("Zero", result[0].Name);
            Assert.Equal("One", result[1].Name);
        }
Ejemplo n.º 2
0
        public void CaseSensitiveReturnsIEnumerableWithSameValues()
        {
            var result = SmartFlagTestEnum.FromName("One, Two", false).ToList();

            Assert.Equal("One", result[0].Name);
            Assert.Equal("Two", result[1].Name);
        }
Ejemplo n.º 3
0
        public void ReturnsIEnumerableWithSameValuesKeyboardBashTest()
        {
            var result = SmartFlagTestEnum.FromName("Five, Four, Three, One, Two, Zero, Other, Values, Ignored, asd, sdf, dfg ,dfg,asd,dfg,sadf,gh,dfgh,afd,asd,asd,af,asf,asf,,asffgfdg,,sdfg,sdg,sd,g,sdf,xcv,cvb,xzcv,asdf,ghdfcg,xc,asdf,asd,dfg,xcvb,asdf,asd,sfg,dfg,xcvb,szxdf,as,fdxc,v,sdf,sdf,sdf,sdf,xdc,sfdg,cvb,dfg,vbcndfg,sdf,das,vxc,gfds,asdf,afds,dgs", false).ToList();

            Assert.Equal("Zero", result[0].Name);
            Assert.Equal("One", result[1].Name);
            Assert.Equal("Two", result[2].Name);
            Assert.Equal("Three", result[3].Name);
            Assert.Equal("Four", result[4].Name);
            Assert.Equal("Five", result[5].Name);
        }
Ejemplo n.º 4
0
        public void ReturnsIEnumerableWithSameValues()
        {
            var result = SmartFlagTestEnum.FromName("Five, Four, Three, One, Two, Zero, Other, Values, Ignored", false).ToList();

            Assert.Equal("Zero", result[0].Name);
            Assert.Equal("One", result[1].Name);
            Assert.Equal("Two", result[2].Name);
            Assert.Equal("Three", result[3].Name);
            Assert.Equal("Four", result[4].Name);
            Assert.Equal("Five", result[5].Name);
        }
Ejemplo n.º 5
0
 public void ThrowsExceptionGivenOutOfRangeValue()
 {
     Assert.Throws <SmartEnumNotFoundException>(() => SmartFlagTestEnum.FromName("Invalid, Value"));
 }