Пример #1
0
        public void Perform_updates_link_and_OfferType_in_inactive_Offer()
        {
            var offer = new Offer()
            {
                Id             = "offer_id_1",
                Link           = "http://www.placeholder.com",
                Title          = "title",
                Cost           = 100.0,
                BonusCost      = 1.0,
                District       = "wealthy",
                Rooms          = 42,
                Area           = 1,
                DateOfPosting  = "1970-01-01",
                DateOfScraping = "1970-01-01",
                Latitude       = 1,
                Longitude      = 1,
                OfferType      = OfferType.Olx,
            };

            _dbOfferRepository.Insert(offer);
            _sut.Perform();

            var result = _dbOfferRepository.Get(OfferConstants.OfferId, "offer_id_1", OfferConstants.CollectionName, 1).First();

            Assert.AreEqual(string.Empty, result.Link);
        }
Пример #2
0
        public void Insert_uploads_document_without_throwing()
        {
            try
            {
                var offer1 = new MarklogicDataLayer.DataStructs.Offer
                {
                    Id             = "1",
                    Title          = "title",
                    Cost           = 100.0,
                    BonusCost      = 1.0,
                    District       = "wealthy",
                    Rooms          = 42,
                    Area           = 40,
                    DateOfPosting  = "1970-01-01",
                    DateOfScraping = "1970-01-01",
                    Latitude       = 1,
                    Longitude      = 1,
                    TotalCost      = 101.0,
                };
                _sut.Insert(offer1);

                Assert.IsTrue(true);
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
        }