public AddProductToCartCommand(System.String cartid, System.String sku, System.Double price, NodaTime.LocalDateTime addtime)
 {
     CartId  = cartid;
     Sku     = sku;
     Price   = price;
     AddTime = addtime;
 }
 public ProductWasAddedToCartEvent(System.String cartid, System.String sku, System.Double price, NodaTime.LocalDateTime addedat)
 {
     CartId  = cartid;
     Sku     = sku;
     Price   = price;
     AddedAt = addedat;
 }
 public CustomerPlacedOrderEvent(System.String cartid, System.String customerid, ProductModel[] products, NodaTime.LocalDateTime orderedat)
 {
     CartId     = cartid;
     CustomerId = customerid;
     Products   = products;
     OrderedAt  = orderedat;
 }
Exemplo n.º 4
0
        public async Task QueryingForExistingCampaign_ReturnsThatCampaign()
        {
            var sp    = new ServiceProviderBuilder().BuildServiceProvider(ConfigureServices);
            var start = new NodaTime.LocalDateTime(2019, 09, 01, 12, 00).InMainTimezone().ToOffsetDateTime();
            var end   = new NodaTime.LocalDateTime(2019, 09, 01, 12, 00).InMainTimezone().ToOffsetDateTime();

            using (var scope = sp.CreateScope())
            {
                var dbSession = scope.ServiceProvider.GetRequiredService <DbSessionProvider>();
                await dbSession.CreateSession().SaveAsync(new Campaign(
                                                              startDateTime: start, endDateTime: end,
                                                              editionId: 1, name: "test"));
            }

            using (var scope = sp.CreateScope())
            {
                var mediator = scope.ServiceProvider.GetRequiredService <IMediator>();

                var query = new Details.Query()
                {
                    CampaignID = 1
                };
                var result = await mediator.Send(query);

                result.IsSuccess.Should().BeTrue();
                result.Value.Should().BeEquivalentTo(new Details.Campaign()
                {
                    ID                  = 1, Name = "test",
                    StartDateTime       = start, EndDateTime = end,
                    CanScheduleTraining = true, IsRecruitmentFormOpen = false,
                    Trainings           = Array.Empty <Recruitment.Trainings.TrainingSummary>()
                });
            }
        }
Exemplo n.º 5
0
        private Training BuildTraining(NodaTime.LocalDateTime from, NodaTime.LocalDateTime to, int id)
        {
            var training = new Training(
                "Papieska 21/37", "Wadowice",
                from.InMainTimezone().ToOffsetDateTime(),
                to.InMainTimezone().ToOffsetDateTime(),
                Guid.NewGuid()
                );

            training.GetType().GetProperty(nameof(Training.ID)).SetValue(training, id);
            return(training);
        }
        public void WhenFhirDocumentReferenceTransformedToHealthVault_ThenEffectiveDateIsSet()
        {
            var json = SampleUtil.GetSampleContent("FhirFile.json");

            var fhirParser        = new FhirJsonParser();
            var documentReference = fhirParser.Parse <DocumentReference>(json);

            var thing = documentReference.ToHealthVault() as ThingBase;

            Assert.IsNotNull(thing);
            Assert.IsNotNull(thing.EffectiveDate);

            var indexed = documentReference.Indexed.Value;
            var indexedLocalDateTime = new NodaTime.LocalDateTime(indexed.Year, indexed.Month, indexed.Day, indexed.Hour, indexed.Minute, indexed.Second);

            Assert.AreEqual(thing.EffectiveDate.Value, indexedLocalDateTime);
        }
        public void WhenHealthVaultThingIsTransformedToFhirDocumentReference_ThenTypeAndStatusAndIndexedFieldsSet()
        {
            string        cdaXmlRaw = SampleUtil.GetSampleContent("CCR.xml");
            XPathDocument xpDoc     = DocumentReferenceHelper.GetXPathDocumentFromXml(cdaXmlRaw);

            CCR ccr = new CCR();

            ccr.TypeSpecificData = xpDoc;
            ccr.EffectiveDate    = new NodaTime.LocalDateTime(2016, 05, 09, 3, 36, 55);

            var documentReference = ccr.ToFhir() as DocumentReference;

            Assert.IsNotNull(documentReference);
            Assert.IsNotNull(documentReference.Type);
            Assert.IsNotNull(documentReference.Status);
            Assert.AreEqual(documentReference.Status, DocumentReferenceStatus.Current);
            Assert.IsNotNull(documentReference.Indexed);

            var indexed = documentReference.Indexed.Value;
            var indexedLocalDateTime = new NodaTime.LocalDateTime(indexed.Year, indexed.Month, indexed.Day, indexed.Hour, indexed.Minute, indexed.Second);

            Assert.AreEqual(indexedLocalDateTime, ccr.EffectiveDate.Value);
        }
 public PlaceOrderCommand(System.String cartid, NodaTime.LocalDateTime ordertime)
 {
     CartId    = cartid;
     OrderTime = ordertime;
 }
 public RemoveProductFromCartCommand(System.String cartid, System.String sku, NodaTime.LocalDateTime addtime)
 {
     CartId  = cartid;
     Sku     = sku;
     AddTime = addtime;
 }
 public StartShoppingCommand(System.String customerid, string cartid, NodaTime.LocalDateTime starttime)
 {
     CustomerId = customerid;
     CartId     = cartid;
     StartTime  = starttime;
 }
 public ProductWasRemovedFromCartEvent(System.String cartid, System.String sku, NodaTime.LocalDateTime removedat)
 {
     CartId    = cartid;
     Sku       = sku;
     RemovedAt = removedat;
 }