private void Awake()
        {
            settingsContainer = ContainerPool.FromPresentation <SettingsScreen.BackendBase, SettingsScreen>(settingsReference)
                                .WithTransformRoot(screenStackRoot.transform);
            settingsContainer.Add().ContinueWith(args =>
            {
                var backend = args.element.Backend;
                backend.DstEntityManager.AddComponent <UIScreen>(backend.BackendEntity);

                args.element.gameObject.SetActive(false);

                var folder = AddressBuilder.Client()
                             .Interface()
                             .Menu()
                             .Folder("Screens")
                             .Folder("SettingsScreen");
                args.element.Data = new SettingsScreenData
                {
                    Panels = new[]
                    {
                        folder.GetAsset("GraphicSettingsPanel"),
                        folder.GetAsset("AudioSettingsPanel")
                    }
                };
            });
        }
Example #2
0
        public async Task SubscribeWithAdressesTest()
        {
            var address = new AddressBuilder().Build();

            try
            {
                var plan = await _gateway.CreatePlan(_planRequestBuilder.Build());

                var customerRequest = _customerRequestBuilder.Build();
                var customer        = await _gateway.CreateCustomer(customerRequest);

                var cardRequest = _cardRequestBuilder.WithCustomerId(customer.Id).Build();

                var subscriptionRequest = new SubscriptionRequest()
                {
                    CustomerId = customer.Id, PlanId = plan.Id, Card = cardRequest, Billing = new Billing()
                    {
                        Address = address, Name = "name", Vat = "123123"
                    }
                };
                var subscription = await _gateway.CreateSubscription(subscriptionRequest);

                Assert.AreEqual(subscription.Billing.Address.FirstLine, address.FirstLine);
                Assert.AreEqual(subscription.Billing.Address.City, address.City);
                Assert.AreEqual(subscription.Billing.Address.CountryISOCode, address.CountryISOCode);
                Assert.AreEqual(subscription.Billing.Address.State, address.State);
            }
            catch (SecurionPayException exc)
            {
                HandleApiException(exc);
            }
        }
Example #3
0
        public void Remove_event_order_explicitly()
        {
            var address   = new AddressBuilder().Build();
            var fakeOrder = new Order(
                userId: "fakeUserId",
                address: address,
                cardTypeId: 1,
                cardNumber: "fakeCardNumber",
                cardSecurityNumber: "fakeCardSecurityNumber",
                cardHolderName: "fakeCardHolderName",
                cardExpiration: DateTime.UtcNow.AddDays(1),
                buyerId: 1,
                paymentMethodId: 2);

            var domainEvent = new OrderCreatedDomainEvent(fakeOrder,
                                                          userId: "fakeUserId",
                                                          cardTypeId: 1,
                                                          cardNumber: "fakeCardNumber",
                                                          cardSecurityNumber: "fakeCardSecurityNumber",
                                                          cardHolderName: "fakeCardHolderName",
                                                          cardExpiration: DateTime.UtcNow.AddDays(1));

            fakeOrder.AddDomainEvent(domainEvent);
            fakeOrder.RemoveDomainEvent(domainEvent);

            Assert.Equal <int>(fakeOrder.DomainEvents.Count, 1);
        }
Example #4
0
        // Implement Patient based on type chosen.

        public NewMemberPresenter(INewMember view)
        {
            this.view      = view;
            personBuilder  = new PersonBuilder();
            addressBuilder = new AddressBuilder();
            view.register(this);
        }
        public static MerchantOrder MakeCompleteOrder()
        {
            var shippingDetail = AddressBuilder.MakeFullAddress();

            var billingDetail = new Address
            {
                FirstName           = "Piet",
                MiddleName          = "van der",
                LastName            = "Stoel",
                Street              = "Dorpsstraat",
                PostalCode          = "4321YZ",
                City                = "Bennebroek",
                CountryCode         = "NL",
                HouseNumber         = "9",
                HouseNumberAddition = "rood"
            };

            var customerInformation = CustomerInformationBuilder.MakeCompleteCustomerInformation();

            return(new MerchantOrder
            {
                MerchantOrderId = "100",
                Description = "Order ID: " + "100",
                OrderItems = new[] { OrderItemBuilder.MakeCompleteOrderItem() },
                Amount = Money.FromDecimal("EUR", 99.99),
                ShippingDetail = shippingDetail,
                BillingDetail = billingDetail,
                CustomerInformation = customerInformation,
                Language = "NL",
                MerchantReturnUrl = "http://localhost/",
                PaymentBrand = PaymentBrand.Ideal,
                PaymentBrandForce = PaymentBrandForce.ForceOnce
            });
        }
Example #6
0
        public void XmlLoadFromStreamTest()
        {
            FileStream stream = new FileStream("PodAddress.xml", FileMode.Open);
            var        lists  = AddressBuilder.Load(stream);

            Assert.IsNotNull(lists);
        }
Example #7
0
        public async Task GenerateHtml_ShouldCallViewRenderWithCorrectPartial_WhenAddressSearch()
        {
            //Arrange
            var element = new AddressBuilder()
                          .WithPropertyText("test")
                          .Build();

            var page = new PageBuilder()
                       .WithElement(element)
                       .Build();

            var viewModel = new Dictionary <string, dynamic>();

            var schema = new FormSchemaBuilder()
                         .WithName("form-name")
                         .Build();

            var formAnswers = new FormAnswers();
            //Act
            var result = await element.RenderAsync(
                _mockIViewRender.Object,
                _mockElementHelper.Object,
                "",
                viewModel,
                page,
                schema,
                _mockHostingEnv.Object,
                formAnswers);

            //Assert
            _mockIViewRender.Verify(_ => _.RenderAsync(It.Is <string>(x => x == "AddressSearch"), It.IsAny <form_builder.Models.Elements.Address>(), It.IsAny <Dictionary <string, object> >()), Times.Once);
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            m_PoolByArchetype = new Dictionary <string, Dictionary <string, AsyncAssetPool <GameObject> > >();
            // TODO: Need to be dynamic in the future (search based in StreamingAssets)
            var modelFolder    = AddressBuilder.Client().Folder("Models");
            var uberHeroFolder = modelFolder.Folder("UberHero");
            var pataponFolder  = modelFolder.Folder("Patapon");

            var archAddr = AddressBuilder.Client().Folder("archetype");
            var kitAddr  = AddressBuilder.Client().Folder("kit");

            var uberHeroMap = new Dictionary <string, AsyncAssetPool <GameObject> >
            {
                [string.Empty] = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("Character")),
                [kitAddr.GetFile("yarida")]       = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterYarida")),
                [kitAddr.GetFile("taterazay")]    = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterTaterazay")),
                [kitAddr.GetFile("guardira")]     = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterGuardira")),
                [kitAddr.GetFile("wooyari")]      = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterYarida")),
                [kitAddr.GetFile("wondabarappa")] = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterWooyari"))
            };

            var ponMap = new Dictionary <string, AsyncAssetPool <GameObject> >
            {
                [string.Empty] = new AsyncAssetPool <GameObject>(pataponFolder.GetAsset("Patapon")),
                [kitAddr.GetFile("yarida")]    = new AsyncAssetPool <GameObject>(pataponFolder.GetAsset("PataponYarida")),
                [kitAddr.GetFile("taterazay")] = new AsyncAssetPool <GameObject>(pataponFolder.GetAsset("PataponTaterazay"))
            };

            m_PoolByArchetype[archAddr.GetFile("uberhero_std_unit")] = uberHeroMap;
            m_PoolByArchetype[archAddr.GetFile("patapon_std_unit")]  = ponMap;
        }
Example #9
0
        // Implement Patient based on type chosen.

        public GPInformationPresenter(IGPInformation view)
        {
            this.view      = view;
            personBuilder  = new PersonBuilder();
            addressBuilder = new AddressBuilder();
            view.register(this);
        }
        private void AddPatientAddress(PatientAddressDto patientAddressDto, Patient patient)
        {
            var addressType         = _mappingHelper.MapLookupField <PatientAddressType> (patientAddressDto.PatientAddressType);
            var countyAreaLookup    = _mappingHelper.MapLookupField <CountyArea> (patientAddressDto.CountyArea);
            var stateProvinceLookup = _mappingHelper.MapLookupField <StateProvince> (patientAddressDto.StateProvince);
            var countryLookup       = _mappingHelper.MapLookupField <Country> (patientAddressDto.Country);

            var address = new AddressBuilder()
                          .WithFirstStreetAddress(patientAddressDto.FirstStreetAddress)
                          .WithSecondStreetAddress(patientAddressDto.SecondStreetAddress)
                          .WithCityName(patientAddressDto.CityName)
                          .WithCountyArea(countyAreaLookup)
                          .WithStateProvince(stateProvinceLookup)
                          .WithCountry(countryLookup)
                          .WithPostalCode(
                string.IsNullOrWhiteSpace(patientAddressDto.PostalCode) ? null : new PostalCode(patientAddressDto.PostalCode))
                          .Build();

            var patientAddress = new PatientAddressBuilder()
                                 .WithPatientAddressType(addressType)
                                 .WithAddress(address)
                                 .WithConfidentialIndicator(patientAddressDto.ConfidentialIndicator)
                                 .WithYearsOfStayNumber(patientAddressDto.YearsOfStayNumber)
                                 .Build();

            patient.AddAddress(patientAddress);
        }
Example #11
0
        public void Address_EqualsAddressDifferentCountyOrRegion_ReturnsFalse()
        {
            var address  = AddressBuilder.NewAddress;
            var address2 = AddressBuilder.WithCountyOrRegion("test county or region");

            Assert.NotEqual(address, address2);
        }
Example #12
0
        public void Address_EqualsAddressDifferentTelephone_ReturnsFalse()
        {
            var address  = AddressBuilder.NewAddress;
            var address2 = AddressBuilder.WithTelephone("test Telephone");

            Assert.NotEqual(address, address2);
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            AudioSource CreateAudioSource(string name, float volume)
            {
                var audioSource = new GameObject("(Clip) " + name, typeof(AudioSource)).GetComponent <AudioSource>();

                audioSource.reverbZoneMix = 0f;
                audioSource.spatialBlend  = 0f;
                audioSource.volume        = volume;

                return(audioSource);
            }

            m_AudioSource = CreateAudioSource("AbilitySwitch", 0.25f);
            GetModule(out m_AsyncOp);

            var path = AddressBuilder.Client()
                       .Folder("Sounds")
                       .Folder("InGame");

            m_AsyncOp.Add(AssetManager.LoadAssetAsync <AudioClip>(path.GetAsset("ability_switch.wav")), new HandleOpData {
            });
        }
Example #14
0
        public void Address_EqualsAddressDifferentCountry_ReturnsFalse()
        {
            var address  = AddressBuilder.WithCountry(new AlwaysUnequalCountry());
            var address2 = AddressBuilder.NewAddress;

            Assert.NotEqual(address, address2);
        }
Example #15
0
        public async Task CreateAsync_CreatesOrganisationWithCorrectValues()
        {
            var expected = OrganisationBuilder.Create(1).WithAddress(AddressBuilder.Create().Build()).Build();

            var calledBack = false;
            var mockOrganisationRepository = new Mock <IOrganisationRepository>();

            mockOrganisationRepository.Setup(r => r.CreateOrganisationAsync(It.IsAny <Organisation>()))
            .Callback((Organisation actual) =>
            {
                actual.Should().BeEquivalentTo(expected, c => c
                                               .Excluding(o => o.OrganisationId)
                                               .Using <DateTime>(ctx => ctx.Subject.Should().BeCloseTo(ctx.Expectation, 1000))
                                               .WhenTypeIs <DateTime>());
                actual.OrganisationId.Should().NotBeEmpty();
                calledBack = true;
            });

            var service = new CreateOrganisationService(mockOrganisationRepository.Object, SetUpValidator(true));

            await service.CreateAsync(SetUpRequest(
                                          expected.Name,
                                          expected.OdsCode,
                                          expected.PrimaryRoleId,
                                          expected.CatalogueAgreementSigned,
                                          expected.Address));

            calledBack.Should().BeTrue();
        }
        public void ToModel_Address_ReturnsAddressModel()
        {
            Address address = AddressBuilder
                              .Create()
                              .WithLine1(Guid.NewGuid().ToString())
                              .WithLine2(Guid.NewGuid().ToString())
                              .WithLine3(Guid.NewGuid().ToString())
                              .WithLine4(Guid.NewGuid().ToString())
                              .WithLine5(Guid.NewGuid().ToString())
                              .WithTown(Guid.NewGuid().ToString())
                              .WithCounty(Guid.NewGuid().ToString())
                              .WithPostcode(Guid.NewGuid().ToString())
                              .WithCountry(Guid.NewGuid().ToString())
                              .Build();

            var actual = address.ToModel();

            AddressModel expected = new AddressModel
            {
                Line1    = address.Line1,
                Line2    = address.Line2,
                Line3    = address.Line3,
                Line4    = address.Line4,
                Line5    = address.Line5,
                Town     = address.Town,
                County   = address.County,
                Postcode = address.Postcode,
                Country  = address.Country
            };

            actual.Should().BeEquivalentTo(expected);
        }
        protected override void SpawnBackend(Entity target)
        {
            if (m_Canvas == null)
            {
                m_Canvas = CanvasUtility.Create(World, 0, "ServerRoom", defaultAddRaycaster: true);
                //CanvasUtility.DisableInteractionOnActivePopup(World, m_Canvas);
            }

            base.SpawnBackend(target);
            var rt = LastBackend.GetComponent <RectTransform>();

            rt.SetParent(m_Canvas.transform, false);

            var folder = AddressBuilder.Client()
                         .Interface()
                         .Menu()
                         .Folder("Screens")
                         .Folder("SettingsScreen");

            LastBackend.Data = new SettingsScreenData
            {
                Panels = new []
                {
                    folder.GetAsset("GraphicSettingsPanel"),
                    folder.GetAsset("AudioSettingsPanel")
                }
            };

            CanvasUtility.ExtendRectTransform(rt);
        }
Example #18
0
        public static ApplicantDetails NewValid(Action <ApplicantDetails> mutator = null)
        {
            var value = new ApplicantDetails
            {
                Title                   = "test title",
                FirstName               = "test first name",
                OtherNames              = "test other names",
                SurnameOrFamilyName     = "test surname or family name",
                DateOfBirth             = DomainRegistry.NowUtc().Date.AddYears(-19),
                PreviouslyLookedAfter   = false,
                FullTimeEducation       = false,
                NationalInsuranceNumber = "AB123456C",
                CurrentAddress          = AddressBuilder.NewValid("applicant"),
                EmailAddress            = "*****@*****.**",
                PhoneNumer              = "01234 567 890",
                MobilePhoneNumber       = "12345 678 901",
            };

            if (mutator != null)
            {
                mutator(value);
            }

            return(value);
        }
Example #19
0
        public void Address_EqualsAddressDifferentEmail_ReturnsFalse()
        {
            var address  = AddressBuilder.NewAddress;
            var address2 = AddressBuilder.WithEmail("test Email");

            Assert.NotEqual(address, address2);
        }
        public When_I_call_PersonParser()
        {
            personParser = new PersonParser();

            string personAsString = Resources.TestCustomer;

            var address = new AddressBuilder()
                .WithA1("123 Fake Street")
                //.WithA2("Fake2")
                //.WithA3("Fake3")
                .WithCity("Fakecity")
                .WithPostCode("F1 23FF")
                .Build();

            expected = new PersonBuilder()
                .WithTitle("Mr")
                //.WithFirstName("Liam")
                .WithLastName("Woods")
                .WithAddress(address)
                .WithEmail("*****@*****.**")
                .Build();

            // Act
            actual = personParser.stringToPerson(personAsString);
        }
Example #21
0
        protected override void OnCreate()
        {
            base.OnCreate();

            m_Canvas                      = World.GetOrCreateSystem <ClientCanvasSystem>().CreateCanvas(out _, "UIDrumCanvas", defaultAddRaycaster: false);
            m_Canvas.renderMode           = RenderMode.WorldSpace;
            m_Canvas.transform.localScale = new Vector3() * 0.05f;

            m_CameraQuery = GetEntityQuery(typeof(GameCamera));

            var address = AddressBuilder.Client()
                          .Folder("Models")
                          .Folder("InGame")
                          .Folder("UIDrum")
                          .GetAsset("UIDrumPressure");

            for (var i = 1; i <= 4; i++)
            {
                DrumPresentationPools[i] = new AsyncAssetPool <GameObject>(address);
                DrumBackendPools[i]      = new AssetPool <GameObject>(CreateBackendDrumGameObject, World);
                DrumVariantCount[i]      = 0;
            }

            timeSystem = World.GetExistingSystem <TimeSystem>();

            m_EngineQuery = GetEntityQuery(typeof(RhythmEngineDescription), typeof(Relative <PlayerDescription>));
        }
Example #22
0
        public void Address_EqualsAddressDifferentTownOrCity_ReturnsFalse()
        {
            var address  = AddressBuilder.NewAddress;
            var address2 = AddressBuilder.WithTownOrCity("test town or city");

            Assert.NotEqual(address, address2);
        }
Example #23
0
        public void Address_EqualsAddressDifferentPostcode_ReturnsFalse()
        {
            var address  = AddressBuilder.NewAddress;
            var address2 = AddressBuilder.WithPostcode("Postcode2");

            Assert.NotEqual(address, address2);
        }
Example #24
0
        public void Address_EqualsAddressDifferentAddress2_ReturnsFalse()
        {
            var address  = AddressBuilder.NewAddress;
            var address2 = AddressBuilder.WithAddress1("test address 2");

            Assert.NotEqual(address, address2);
        }
Example #25
0
            public static Address WithCountry(Country country)
            {
                var builder = new AddressBuilder();

                builder.Country = country;

                return(builder.Build());
            }
Example #26
0
            public static Address WithEmail(string email)
            {
                var builder = new AddressBuilder();

                builder.Email = email;

                return(builder.Build());
            }
Example #27
0
            public static Address WithTelephone(string telephone)
            {
                var builder = new AddressBuilder();

                builder.Telephone = telephone;

                return(builder.Build());
            }
Example #28
0
            public static Address WithPostcode(string postcode)
            {
                var builder = new AddressBuilder();

                builder.Postcode = postcode;

                return(builder.Build());
            }
Example #29
0
            public static Address WithTownOrCity(string townOrCity)
            {
                var builder = new AddressBuilder();

                builder.TownOrCity = townOrCity;

                return(builder.Build());
            }
Example #30
0
            public static Address WithCountyOrRegion(string countyOrRegion)
            {
                var builder = new AddressBuilder();

                builder.CountyOrRegion = countyOrRegion;

                return(builder.Build());
            }
Example #31
0
            public static Address WithAddress2(string address2)
            {
                var builder = new AddressBuilder();

                builder.Address2 = address2;

                return(builder.Build());
            }
        public void SetUp()
        {
            _addressBuilder = new AddressBuilder();

            var vehicle = new Vehicle { tankCapacity = 20, averageConsumption = 9, fuelPrice = 3, averageSpeed = 60 };

            _calculator = new RoteValuesCalculator(vehicle);
        }
        public AddressBuilderTests()
        {
            countryRepository = A.Fake<ICountryRepository>();

            var uk = CountryFactory.Create(ukId, "United Kingdom");
            var france = CountryFactory.Create(nonUkId, "France");

            A.CallTo(() => countryRepository.GetById(ukId)).Returns(uk);
            A.CallTo(() => countryRepository.GetById(nonUkId)).Returns(france);

            addressBuilder = new AddressBuilder(countryRepository);
        }
        public void Should_get_TestDataBuilderPropertySetter_with_ITestDataBuilder_object()
        {
            // Arrange
            var value = new AddressBuilder();
            var factory = new PropertySetterFactory();

            // Act
            var propertySetter = factory.GetPropertySetter<Address>(value);

            // Assert
            propertySetter.ShouldNotBeNull();
            propertySetter.GetType().ShouldBeTheSameAs(typeof(TestDataBuilderPropertySetter<Address>));
        }
Example #35
0
 public User BuildWithDefaults()
 {
     AddressBuilder addressBuilder = new AddressBuilder();
     List<Address> defaultAddresses = new List<Address>();
     defaultAddresses.Add(addressBuilder.BuildWithDefaults());
     PhoneBuilder phoneBuilder = new PhoneBuilder();
     List<Phone> defaultPhones = new List<Phone>();
     defaultPhones.Add(phoneBuilder.BuildWithDefaults());
     EmailBuilder emailBuilder = new EmailBuilder();
     List<Email> defaultEmails = new List<Email>();
     defaultEmails.Add(emailBuilder.BuildWithDefaults());
     return WithUserName("DefaultUser")
         .WithFirstName("Default")
         .WithLastName("User")
         .WithAddresses(defaultAddresses)
         .WithPhones(defaultPhones)
         .WithEmails(defaultEmails)
         .Build();
 }
        public When_I_call_PersonRepository()
        {
            var address = new AddressBuilder().WithA1("123 Fake Street").WithCity("Fakecity").WithPostCode("F1 23FF").Build();

            expected = new PersonBuilder()
                .WithTitle("Mr")
                .WithFirstName("Liam")
                .WithLastName("Woods")
                .WithEmail("*****@*****.**")
                .WithAddress(address)
                .Build();

            personParser = Substitute.For<IPersonParser>();
            personParser.stringToPerson(Resources.TestCustomer).Returns(expected);

            personRepository = new PersonRepository(personParser);

            // Act
            actual = personRepository.Persons(Resources.TestCustomer).ToList();
        }
Example #37
0
 public void SetUp()
 {
     _addressBuilder = new AddressBuilder();
     _householdBuilder = new HouseholdBuilder();
 }
        public void Should_find_a_address_point()
        {
            var address = new AddressBuilder("Av. Paulista", "200", "São Paulo", "São Paulo").Address;

            Assert.IsNotNull(address.Point);
        }