示例#1
0
        public void ArgumentNotNullObjectWithDefaultTest()
        {
            PersonProper nullPerson    = null;
            var          defaultPerson = RandomData.GenerateRefPerson <PersonProper>();

            try
            {
                var result = nullPerson.ArgumentNotNull(defaultPerson);

                Assert.AreEqual(result, defaultPerson);
            }
            catch
            {
                Assert.Fail();
            }
        }
示例#2
0
        public void ArgumentNotNullObjectTest()
        {
            var testPerson = RandomData.GenerateRefPerson <PersonProper>();

            try
            {
                testPerson.ArgumentNotNull();
            }
            catch
            {
                Assert.Fail();
            }

            PersonProper nullPerson = null;

            _ = Assert.ThrowsException <ArgumentNullException>(() => nullPerson.ArgumentNotNull());
        }