Exemple #1
0
        public void Serialize_ShouldReturnObjArgument_ForNonNullObjArgument()
        {
            // Arrange.
            var target = new BinaryPassThroughSerializer();
            var serializationTarget = new Byte[] { 0x03 };

            // Act.
            var result = target.Serialize(serializationTarget);

            // Assert.
            result.Should().NotBeNull();
            result.Length.Should().Be(serializationTarget.Length);
            result[0].Should().Be(serializationTarget[0]);
        }
Exemple #2
0
        public void Serialize_ShouldRaiseArgumentNullException_ForNullObjArgument()
        {
            // Arrange.
            var target = new BinaryPassThroughSerializer();
            var serializationTarget = (Byte[])null;

            // Act.
            var action = new Action(() =>
            {
                var result = target.Serialize(serializationTarget);
            });

            // Assert.
            action.Should().Throw <ArgumentNullException>();
        }