コード例 #1
0
        public void GivenAResultThenTheValueIsReturned(int[] values)
        {
            var context = new SerializableMessage();
            var result  = new SerializableEnumerableResult <int>(context, values);

            int[] actual   = result;
            int[] expected = values ?? Array.Empty <int>();

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void GivenAnInstanceThenAllPropertiesAreSerialized()
        {
            var context = new SerializableMessage();
            var result  = new SerializableEnumerableResult <int>(context, new[] { 1, 2, 3 });
            SerializableEnumerableResult <int> deserialized = result.Clone();

            Assert.Equal(result, deserialized);
            Assert.NotSame(result, deserialized);
            Assert.Equal(result.Value, deserialized.Value);
            Assert.Equal(result.GetHashCode(), deserialized.GetHashCode());
        }