Пример #1
0
        public void TradeEventType_ValidInput_Parsed(string input)
        {
            // Arrange
            var converter  = new HuobiEnumJsonConverter();
            var jsonReader = CreateAndPrepareJsonReader(input);

            // Act
            var output = converter.ReadJson(jsonReader, typeof(TradeEventType), null, null !);

            // Assert
            Assert.NotNull(output);
            Assert.NotEqual(TradeEventType.Unknown, output);
        }
Пример #2
0
        public void OrderEventType_InvalidInput_ParsedWithDefaultValue()
        {
            // Arrange
            var converter  = new HuobiEnumJsonConverter();
            var jsonReader = CreateAndPrepareJsonReader("invalid-input");

            // Act
            var output = converter.ReadJson(jsonReader, typeof(OrderEventType), null, null !);

            // Assert
            Assert.NotNull(output);
            Assert.Equal(OrderEventType.Unknown, output);
        }