Example #1
0
 public GiftCollection FetchAll()
 {
     GiftCollection coll = new GiftCollection();
     Query qry = new Query(Gift.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
Example #2
0
        public GiftCollection GetDummyGiftCollection()
        {
            var giftDict       = new Dictionary <string, IGift>();
            var giftCollection = new GiftCollection();

            return(giftCollection);
        }
Example #3
0
        public Event GetEvent(string custId, GiftCollection giftCollectionR, GiftCollection giftCollectionE)
        {
            string eventId      = Guid.NewGuid().ToString();
            var    OccasionMock = new Mock <IOccassion>();

            return(new Event(eventId, OccasionMock.Object, "thisPlace", new DateTime(2020, 05, 05), giftCollectionE, giftCollectionR, custId, false));
        }
Example #4
0
        public void Setup()
        {
            logger   = new Mock <ILog>();
            giftR    = new GiftCollection();
            giftE    = new GiftCollection();
            custId   = Guid.NewGuid().ToString();
            customer = new Customer("userName", "password");

            customer1 = new Customer("userName2", "password");
        }
Example #5
0
        public Event CreateEmptyEvent(string custId)
        {
            var mockOccasion           = new Mock <IOccassion>();
            var place                  = "test place";
            var date                   = new DateTime(2020, 6, 3);
            var giftCollectionExpected = new GiftCollection();
            var giftCollectionRecieved = new GiftCollection();

            return(new Event(mockOccasion.Object, place, date, custId));
        }
        public IGiftCollection <IGift> GetGiftsForGiftIds(string [] giftIdList)
        {
            var giftCollection = new GiftCollection();

            foreach (var giftId in giftIdList)
            {
                var gift = (IGift)giftDao.Read(giftId);
                logger.InfoFormat("Gift with id {0} added", gift.getId());
                giftCollection.Add(gift);
            }

            return(giftCollection);
        }
Example #7
0
        public ActionResult <string> CreateEvent(Event event1)
        {
            customerController.SetCustomer(loggedInCustomer);
            logger.Info("Came here");
            var format = "yyyy-MM-dd HH:mm";
            var giftE  = selectionController.GetGiftsForGiftIds(event1.giftIds);
            var giftR  = new GiftCollection();
            var date   = DateTime.ParseExact(event1.date + " " + event1.time, format, CultureInfo.InvariantCulture);

            logger.Info("date is formateed to " + date.ToString());
            IOccassion occassionInQ = selectionController.GetOccassion(event1.occassionType, event1.person1, event1.person2);

            customerController.CreateOccassion(occassionInQ);
            var result = customerController.CreateEvent(occassionInQ, event1.place, date, giftE, giftR);

            customerController.AddToExpectedGifts(giftE, result);
            return(result);
        }
Example #8
0
 public Invitation GetInvitation(GiftCollection giftCollectionR, GiftCollection giftCollectionE, CustomerCollection customerCollection)
 {
     return(new Invitation(customer, GetEvent(customer1.getId(), giftCollectionR, giftCollectionE)));
 }
Example #9
0
 public void GetGiftCollection()
 {
     GiftCollection.Add(new GiftModel {
         AppImage = "ms-appx:///Assets/GiftImages/ITHome+.png", AppName = "微IT", AppDesc = "纯,只为你而来", AppProductUri = new Uri("ms-windows-store://pdp/?ProductId=9NBLGGH08TFH")
     });
 }
Example #10
0
 public GiftCollection FetchByQuery(Query qry)
 {
     GiftCollection coll = new GiftCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
Example #11
0
 public GiftCollection FetchByID(object GiftKey)
 {
     GiftCollection coll = new GiftCollection().Where("Gift_Key", GiftKey).Load();
     return coll;
 }