예제 #1
0
        public void TestListingConversion()
        {
            var rawListing = new Listing
            {
                ListDate = new DateTimeValue {
                    value = new DateTime(2014, 6, 7, 8, 9, 10)
                },
                Price = new MoneyValue
                {
                    Currency = "GBP",
                    value    = 12.34f
                },
                Condition = new StringValue {
                    value = "Mint"
                },
                Notes = new StringValue {
                    value = "Really mint"
                },
                Link = new LinkValue
                {
                    HRef  = "http://www.example.com/",
                    Title = "Example link"
                }
            };

            var listing = new BGGThings.MarketplaceListing(rawListing);

            Assert.AreEqual(new DateTime(2014, 6, 7, 8, 9, 10), listing.ListingDate);
            Assert.AreEqual("GBP", listing.Currency);
            Assert.AreEqual(12.34f, listing.CurrencyValue);
            Assert.AreEqual("Mint", listing.Condition);
            Assert.AreEqual("Really mint", listing.Notes);
            Assert.AreEqual(new Uri("http://www.example.com/"), listing.Link);
            Assert.AreEqual("Example link", listing.LinkTitle);
        }
예제 #2
0
        public void TestListingConversion()
        {
            var rawListing = new Listing
            {
                ListDate = new DateTimeValue { value = new DateTime(2014, 6, 7, 8, 9, 10) },
                Price = new MoneyValue
                {
                    Currency = "GBP",
                    value = 12.34f
                },
                Condition = new StringValue { value = "Mint" },
                Notes = new StringValue { value = "Really mint" },
                Link = new LinkValue
                {
                    HRef = "http://www.example.com/",
                    Title = "Example link"
                }
            };

            var listing = new BGGThings.MarketplaceListing(rawListing);

            Assert.AreEqual(new DateTime(2014, 6, 7, 8, 9, 10), listing.ListingDate);
            Assert.AreEqual("GBP", listing.Currency);
            Assert.AreEqual(12.34f, listing.CurrencyValue);
            Assert.AreEqual("Mint", listing.Condition);
            Assert.AreEqual("Really mint", listing.Notes);
            Assert.AreEqual(new Uri("http://www.example.com/"), listing.Link);
            Assert.AreEqual("Example link", listing.LinkTitle);
        }