コード例 #1
0
        public void Serialize_Wrong_Type_Throws()
        {
            // arrange
            var    type  = new MultiplierPathType();
            object input = 123456;

            // act
            // assert
            Assert.Throws <ScalarSerializationException>(
                () => type.Serialize(input));
        }
コード例 #2
0
        public void Serialize_Null()
        {
            // arrange
            var type = new MultiplierPathType();

            // act
            object serializedValue = type.Serialize(null);

            // assert
            Assert.Null(serializedValue);
        }
コード例 #3
0
        public void Serialize_Type()
        {
            // arrange
            var type = new MultiplierPathType();
            MultiplierPathString input = "_123456";

            // act
            object serializedValue = type.Serialize(input);

            // assert
            Assert.IsType <string>(serializedValue);
            Assert.Equal("_123456", serializedValue);
        }