예제 #1
0
        public void NullGuidTest()
        {
            var prm1 = new SqlParameter("1", SqlDbType.UniqueIdentifier)
            {
                Value = System.DBNull.Value
            };

            prm1.GetNullableGuid().Should().BeNull("that was a null database guid value");
            prm1.GetGuid().Should().Be(Guid.Empty, "that was a null database guid value");
            var prm2 = new SqlParameter("2", SqlDbType.UniqueIdentifier)
            {
                Value = Guid.Empty
            };

            prm2.GetGuid().Should().Be(Guid.Empty, "that was an empty database guid value");
            prm2.GetNullableGuid().Should().Be(Guid.Empty, "that was an empty database guid value");
        }