예제 #1
0
        public void TypeName_Custom()
        {
            // arrange
            var serializer = new BooleanSerializer("Abc");

            // act
            string typeName = serializer.TypeName;

            // assert
            Assert.Equal("Abc", typeName);
        }
예제 #2
0
        public void Parse()
        {
            // arrange
            var serializer = new BooleanSerializer();

            // act
            bool?result = serializer.Parse(true);

            // assert
            Assert.True(Assert.IsType <bool>(result));
        }
예제 #3
0
        public void TypeName_Default()
        {
            // arrange
            var serializer = new BooleanSerializer();

            // act
            string typeName = serializer.TypeName;

            // assert
            Assert.Equal("Boolean", typeName);
        }
예제 #4
0
        public void Format_False()
        {
            // arrange
            var serializer = new BooleanSerializer();

            // act
            object?result = serializer.Format(false);

            // assert
            Assert.False(Assert.IsType <bool>(result));
        }
예제 #5
0
        public void Format_Null()
        {
            // arrange
            var serializer = new BooleanSerializer();

            // act
            object?result = serializer.Format(null);

            // assert
            Assert.Null(result);
        }
예제 #6
0
        public void Format_True()
        {
            // arrange
            var serializer = new BooleanSerializer();

            // act
            var result = serializer.Format(true);

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