예제 #1
0
        public void Test_FourCharacterCode_Value()
        {
            var fcc = new FourCharacterCode("ABCD");

            fcc.Value.Should().Be("ABCD");
            fcc.ToString().Should().Be("ABCD");
        }
예제 #2
0
        public virtual Type LookupChunkObjectType(FourCharacterCode chunkTypeId)
        {
            Check.IfArgumentNull(chunkTypeId, "chunkTypeId");

            string chunkId = chunkTypeId.ToString();

            if (!chunkId.HasWildcard())
            {
                Type result = null;

                // try fast lookup first if the requested type has no wildcards
                if (this.chunkMap.TryGetValue(chunkId, out result))
                {
                    return(result);
                }
            }

            // now match wildcards
            foreach (var item in this.chunkMap)
            {
                if (chunkId.MatchesWith(item.Key))
                {
                    return(item.Value);
                }
            }

            return(null);
        }
예제 #3
0
        public void Test_FourCharacterCode_Value()
        {
            FourCharacterCode fcc = new FourCharacterCode();

            fcc.Value = "ABCD";
            Assert.AreEqual("ABCD", fcc.Value);
            Assert.AreEqual("ABCD", fcc.ToString());
        }
예제 #4
0
        public void Test_FourCharacterCode_ConstructChars()
        {
            FourCharacterCode fcc = new FourCharacterCode('A', 'B', 'C', 'D');

            Assert.AreEqual("ABCD", fcc.ToString());
        }
예제 #5
0
        public void Test_FourCharacterCode_ConstructString()
        {
            FourCharacterCode fcc = new FourCharacterCode("ABCD");

            Assert.AreEqual("ABCD", fcc.ToString());
        }
예제 #6
0
        public void Test_FourCharacterCode_ConstructString()
        {
            var fcc = new FourCharacterCode("ABCD");

            fcc.ToString().Should().Be("ABCD");
        }