Exemple #1
0
        public void Serialize_Wrong_Type_Throws()
        {
            // arrange
            var    type  = new IdType();
            object input = Guid.NewGuid();

            // act
            // assert
            Assert.Throws <ArgumentException>(() => type.Serialize(input));
        }
Exemple #2
0
        public void Serialize_Null()
        {
            // arrange
            var type = new IdType();

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

            // assert
            Assert.Null(serializedValue);
        }
Exemple #3
0
        public void Serialize_String()
        {
            // arrange
            var type  = new IdType();
            var input = "123456";

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

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