예제 #1
0
        public void Reference_Type_Homogenizer_Homogenizes_Instances_Of_Supported_Type()
        {
            var homogenizer = new ToUpperCaseHomogenizer();

            homogenizer
            .Homogenize("For Whom the Bell Tolls")
            .Should()
            .Be("FOR WHOM THE BELL TOLLS");
            homogenizer
            .Homogenize("something STUPID")
            .Should()
            .Be("SOMETHING STUPID");
            string nullValue = null;

            homogenizer
            .Homogenize(nullValue)
            .Should()
            .BeNull();
        }
예제 #2
0
        public void Reference_Type_Homogenizer_Does_Not_Affect_Instances_Of_Unsupported_Types()
        {
            var homogenizer = new ToUpperCaseHomogenizer();

            homogenizer
            .Homogenize(24)
            .Should()
            .Be(24);
            homogenizer
            .Homogenize(3.141592684d)
            .Should()
            .Be(3.141592684d);
            DateTimeOffset now = DateTimeOffset.Now;

            homogenizer
            .Homogenize(now)
            .Should()
            .Be(now);
            var instance = new OutOfMemoryException();

            homogenizer
            .Homogenize(instance)
            .Should()
            .Be(instance);
            uint?anotherInstance = uint.MaxValue;

            homogenizer
            .Homogenize(anotherInstance)
            .Should()
            .Be(uint.MaxValue);
            ArgumentNullException nullValue = null;

            homogenizer
            .Homogenize(nullValue)
            .Should()
            .BeNull();
            decimal?anotherNullValue = null;

            homogenizer
            .Homogenize(anotherNullValue)
            .Should()
            .BeNull();
        }