Пример #1
0
        public void Deserialize_Null_Null()
        {
            // arrange
            BooleanType booleanType = new BooleanType();

            // act
            object result = booleanType.Serialize(null);

            // assert
            Assert.Null(result);
        }
Пример #2
0
        public void Serialize_String_Exception()
        {
            // arrange
            BooleanType booleanType = new BooleanType();

            // act
            Action a = () => booleanType.Serialize("foo");

            // assert
            Assert.Throws <ArgumentException>(a);
        }
Пример #3
0
        public void Deserialize_String_Exception()
        {
            // arrange
            var booleanType = new BooleanType();

            // act
            Action a = () => booleanType.Serialize("foo");

            // assert
            Assert.Throws <SerializationException>(a);
        }
Пример #4
0
        public void Serialize_True_True()
        {
            // arrange
            BooleanType booleanType = new BooleanType();

            // act
            object result = booleanType.Serialize(true);

            // assert
            Assert.IsType <bool>(result);
            Assert.True((bool)result);
        }