示例#1
0
        public void Close_method_returns_a_close_event()
        {
            AuctionEvent auctionEvent = AuctionEvent.Close();

            auctionEvent.Type.ShouldEqual(AuctionEventType.Close);
            auctionEvent.ToString().ShouldEqual("SOLVersion: 1.1; Event: CLOSE;");
        }
示例#2
0
        public void Parses_close_events()
        {
            string message = "SOLVersion: 1.1; Event: CLOSE;";

            AuctionEvent auctionEvent    = AuctionEvent.From(message);
            string       serializedEvent = auctionEvent.ToString();

            auctionEvent.Type.ShouldEqual(AuctionEventType.Close);
            serializedEvent.ShouldEqual(message);
        }
示例#3
0
        public void Price_method_returns_a_price_event()
        {
            AuctionEvent auctionEvent = AuctionEvent.Price(1, 2, "bidder");

            auctionEvent.Type.ShouldEqual(AuctionEventType.Price);
            auctionEvent.CurrentPrice.ShouldEqual(1);
            auctionEvent.Increment.ShouldEqual(2);
            auctionEvent.Bidder.ShouldEqual("bidder");
            auctionEvent.ToString().ShouldEqual("SOLVersion: 1.1; Event: PRICE; CurrentPrice: 1; Increment: 2; Bidder: bidder;");
        }
示例#4
0
        public void Parses_price_events()
        {
            string message = "SOLVersion: 1.1; Event: PRICE; CurrentPrice: 12; Increment: 34; Bidder: sniper-56;";

            AuctionEvent auctionEvent    = AuctionEvent.From(message);
            string       serializedEvent = auctionEvent.ToString();

            auctionEvent.Type.ShouldEqual(AuctionEventType.Price);
            auctionEvent.CurrentPrice.ShouldEqual(12);
            auctionEvent.Increment.ShouldEqual(34);
            auctionEvent.Bidder.ShouldEqual("sniper-56");
            serializedEvent.ShouldEqual(message);
        }