コード例 #1
0
        public void TyrParse_StringValue_IsNotValid()
        {
            string str = "string";

            Assert.IsFalse(BusinessIdentifierCode.TryParse(str, out BusinessIdentifierCode val), "Valid");
            Assert.AreEqual(string.Empty, val.ToString(), "Value");
        }
コード例 #2
0
        public void TyrParse_StringValue_IsValid()
        {
            string str = "AEGONL2UXXX";

            Assert.IsTrue(BusinessIdentifierCode.TryParse(str, out BusinessIdentifierCode val), "Valid");
            Assert.AreEqual(str, val.ToString(), "Value");
        }
コード例 #3
0
        public void TyrParse_Questionmark_IsValid()
        {
            string str = "?";

            Assert.IsTrue(BusinessIdentifierCode.TryParse(str, out BusinessIdentifierCode val), "Valid");
            Assert.IsTrue(val.IsUnknown(), "Value");
        }
コード例 #4
0
        public void TyrParse_StringEmpty_IsValid()
        {
            string str = string.Empty;

            Assert.IsTrue(BusinessIdentifierCode.TryParse(str, out BusinessIdentifierCode val), "Valid");
            Assert.AreEqual(string.Empty, val.ToString(), "Value");
        }
コード例 #5
0
        public void TryParse_InvalidInput_DefaultValue()
        {
            using (new CultureInfoScope("en-GB"))
            {
                var exp = default(BusinessIdentifierCode);
                var act = BusinessIdentifierCode.TryParse("InvalidInput");

                Assert.AreEqual(exp, act);
            }
        }
コード例 #6
0
        public void TryParse_TestStructInput_AreEqual()
        {
            using (new CultureInfoScope("en-GB"))
            {
                var exp = TestStruct;
                var act = BusinessIdentifierCode.TryParse(exp.ToString());

                Assert.AreEqual(exp, act);
            }
        }