Esempio n. 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;");
        }
Esempio n. 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);
        }
Esempio n. 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;");
        }
Esempio n. 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);
        }