Пример #1
0
        public void Test_Reading_A_Primitive_From_A_Null_Reader <T>(PrimitiveTypeTestCaseData <T> testCaseData)
            where T : struct
        {
            IDataNode node   = new PrimitiveTypeDataNode <T>();
            Action    action = () => node.Read(null);

            action.Should()
            .ThrowArgumentNullException("binaryReader");
        }
Пример #2
0
        public void Test_Reading_A_Primitive <T>(PrimitiveTypeTestCaseData <T> testCaseData)
            where T : struct
        {
            IDataNode node = new PrimitiveTypeDataNode <T>();

            testCaseData.SetupRead(binaryReader);

            object result = node.Read(binaryReader);

            result.Should()
            .BeOfType(typeof(T))
            .And
            .Be(testCaseData.Value);
        }