public void CreateFromString_ValidMessageString_ReturnsMessageObject()
        {
            var instance = OpenOrdersMessage.CreateFromString(TestSocketMessages.OpenOrdersMessage);

            Assert.NotNull(instance);
            Assert.IsType <OpenOrdersMessage>(instance);
            Assert.Equal("openOrders", instance.ChannelName);
            Assert.Equal(4, instance.Orders.Count());
        }
        private void HandlePrivateContent(KrakenMessageEventArgs eventArgs)
        {
            // handle private content
            if (eventArgs.RawContent.Contains(@"""ownTrades"""))
            {
                var ownTrades = OwnTradesMessage.CreateFromString(eventArgs.RawContent);
                OwnTradesReceived.InvokeAll(this, new KrakenPrivateEventArgs <OwnTradesMessage>(ownTrades));
            }

            if (eventArgs.RawContent.Contains(@"""openOrders"""))
            {
                var openOrders = OpenOrdersMessage.CreateFromString(eventArgs.RawContent);
                OpenOrdersReceived.InvokeAll(this, new KrakenPrivateEventArgs <OpenOrdersMessage>(openOrders));
            }
        }
 public void CreateFromString_Null_ThrowsArgumentNullException()
 {
     Assert.Equal("rawMessage",
                  Assert.Throws <ArgumentNullException>(
                      () => OpenOrdersMessage.CreateFromString(null)).ParamName);
 }