コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: cmd-coder/URP
        public void matchLName_LastName_ReturnsTrue()//Test last name of the user
        {
            patternMatch obj    = new patternMatch();
            string       fName  = "Lastname";
            bool         result = obj.matchLName(fName);

            Assert.AreEqual(true, result);
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: cmd-coder/URP
        public void matchLName_LastName_ThrowsCustomException()//Test last name of the user
        {
            patternMatch obj   = new patternMatch();
            string       fName = "lastname";

            try
            {
                bool checkLName = obj.matchLName(fName);
            }
            catch (CustomException ce)
            {
                Assert.AreEqual("Invalid Last Name", ce.Message);
            }
        }