Esempio n. 1
0
        public void BuildTest()
        {
            var typeMember = new CodeMemberMethod()
            {
                Name = "TypeMemberTest"
            };
            var propData = mocks.Stub <IBuilderData>();

            Expect.Call(buildcontext.TypeMember).Return(typeMember);
            //Expect.Call(buildcontext.GetBuilderData("Property")).Return(propData);

            // is not relevant ... just a devel-testing call to
            // "var userData = context.GetBuilderData<BuildParametersOfPropertyBuilder>(this);"
            Expect.Call(buildcontext.GetBuilderData <BuildParametersOfPropertyBuilder>(testObject)).Return(null);
            Expect.Call(buildcontext.GetBuilderData("Property")).Return(propData).Repeat.Any();
            var testClass = new CodeTypeDeclaration("TheClass");

            Expect.Call(buildcontext.TestClassDeclaration).Return(testClass).Repeat.Any();
            //Expect.Call(buildcontext.IsProperty).Return(true);
            mocks.ReplayAll();

            testObject.Build(this.buildcontext);

            // Todo: check if only the ending "Test" gets replaced.
            var expected = "TypeMemberNormalBehavior";
            var actual   = typeMember.Name;

            Assert.AreEqual(expected, actual);

            mocks.VerifyAll();
        }
Esempio n. 2
0
        public void TestBuild_NoType()
        {
            PropertyBuilder b = new PropertyBuilder();

            b.Name = "Test";
            b.Build();
        }
Esempio n. 3
0
        public virtual void SaveStatus()
        {
            var builder = new PropertyBuilder <Advert>()
                          .Append(x => x.CurrentStatus)
                          .Append(x => x.TotalSecsActive);

            // HACK: Parser ma problemy z DateTime? == null -> nie uwzględniamy ich w savie
            if (StatusLastChangedDate.HasValue)
            {
                builder.Append(x => x.StatusLastChangedDate);
            }
            if (CreationDate.HasValue)
            {
                builder.Append(x => x.CreationDate);
            }
            if (StartDate.HasValue)
            {
                builder.Append(x => x.StartDate);
            }
            if (EndDate.HasValue)
            {
                builder.Append(x => x.EndDate);
            }

            SavePartially(IsUpToDate, builder.Build());
        }
Esempio n. 4
0
            private PropertyInfo[] buildAdPackProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.AdPackName)
                .Append(x => x.AdPackNamePlural)
                .Append(x => x.PolicyInt)
                .Append(x => x.CustomReturnOptionInt)
                .Append(x => x.DistributionPolicyInt)
                .Append(x => x.PackNormalBannerHeight)
                .Append(x => x.PackNormalBannerWidth)
                .Append(x => x.PackConstantBannerHeight)
                .Append(x => x.PackConstantBannerWidth)
                .Append(x => x.EnableAdvertChange)
                .Append(x => x.DirectReferersProfitPercentage)
                .Append(x => x.StartPagePrice)
                .Append(x => x.IsStartPageEnabled)
                .Append(x => x.IsStartSurfingEnabled)
                .Append(x => x.IsAdListEnabled)
                .Append(x => x.DailyRequiredAdClicks)
                .Append(x => x.IsTimeClickExchangeEnabled)
                .Append(x => x.BuyAdPacksDirectlyFromPaymentProcessorOnly)
                .Append(x => x.RevShareCustomGroupRewardsEnabled)
                .Append(x => x.EnableAdvertAutoApproval)
                .Append(x => x.BuyAdPacksForReferralsEnabled)
                .Append(x => x.MaxAdPacksForOtherUser)
                .Append(x => x.AdminsAdvertDisplayTime)
                .Append(x => x.MaxDailyROIPercent)
                .Append(x => x.InstantAccrualsEnabled)
                .Append(x => x.HideAdPackTypesWhenOneEnabled);

                return(exValues.Build());
            }
Esempio n. 5
0
            private PropertyInfo[] buildMatrixProperties()
            {
                var MatrixProperties = new PropertyBuilder <AppSettingsTable>();

                MatrixProperties
                .Append(x => x.MaxChildrenInMatrix)
                .Append(x => x.DaysBetweenMatrixRebuild)
                .Append(x => x.LastMatrixRebuild)
                .Append(x => x.MatrixCheckPtc)
                .Append(x => x.MatrixCheckBanner)
                .Append(x => x.MatrixCheckFacebook)
                .Append(x => x.MatrixCheckCpa)
                .Append(x => x.MatrixCheckLogin)
                .Append(x => x.MatrixCheckTrafficGrid)
                .Append(x => x.MatrixCheckAdPack)
                .Append(x => x.MatrixCheckExternalBanner)
                .Append(x => x.MatrixCheckInText)
                .Append(x => x.MatrixCheckPtcOfferWall)
                .Append(x => x.MatrixTypeInt)
                .Append(x => x.MatrixCrediterInt)
                .Append(x => x.MatrixCheckInvestmentPlatform)
                .Append(x => x.MatrixMaxCreditedLevels)
                .Append(x => x.AutolocateMembersInBinaryMatrix)
                .Append(x => x.MatrixCyclesFromRank)
                .Append(x => x.MatrixCyclesPerDay)
                .Append(x => x.MatrixCyclesBonusMoneyFromLeg)
                .Append(x => x.MatrixCyclesPrizeMoney);

                return(MatrixProperties.Build());
            }
Esempio n. 6
0
        public void TestBuild_NoName()
        {
            PropertyBuilder b = new PropertyBuilder();

            b.PropertyType = typeof(string);
            b.Build();
        }
Esempio n. 7
0
            private PropertyInfo[] buildPowerPacksProperties()
            {
                var paymentsValues = new PropertyBuilder <AppSettingsTable>();

                paymentsValues
                .Append(x => x.PowerPacks);

                return(paymentsValues.Build());
            }
Esempio n. 8
0
            private PropertyInfo[] buildAffiliateNetworkProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.AffiliateNetworkEnabled)
                .Append(x => x.MinutesBetweenExternalBannerClicksPerIp);
                return(exValues.Build());
            }
    private PropertyInfo[] BuildLevelCommission()
    {
        PropertyBuilder <LeadershipInvestmentLevelCommission> builder = new PropertyBuilder <LeadershipInvestmentLevelCommission>();

        builder.Append(x => x.CommissionLevel)
        .Append(x => x.Commission);

        return(builder.Build());
    }
Esempio n. 10
0
            private PropertyInfo[] buildSSLProperties()
            {
                var paymentsValues = new PropertyBuilder <AppSettingsTable>();

                paymentsValues
                .Append(x => x.SSLType);

                return(paymentsValues.Build());
            }
Esempio n. 11
0
            private PropertyInfo[] buildSharesProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.PorftolioSharesPolicyInt)
                .Append(x => x.SharesMarketSaleCommission);
                return(exValues.Build());
            }
Esempio n. 12
0
        private PropertyInfo[] BuildInvestmentPlans()
        {
            PropertyBuilder <Member> builder = new PropertyBuilder <Member>();

            builder.Append(x => x.InvestedIntoPlans)
            .Append(x => x.InvestedIntoPlansStructure);

            return(builder.Build());
        }
Esempio n. 13
0
        public void TestBuild_PublicTypeNoConverter()
        {
            PropertyBuilder b = new PropertyBuilder();

            b.Name         = "Test";
            b.PropertyType = typeof(double);
            b.PublicType   = typeof(string);
            b.Build();
        }
Esempio n. 14
0
            private PropertyInfo[] buildCommunicationProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.TawkLiveChatKey)
                .Append(x => x.TawkLiveChatEnabled);
                return(exValues.Build());
            }
Esempio n. 15
0
        public void TestBuild_BadDefaultValue()
        {
            PropertyBuilder b = new PropertyBuilder();

            b.Name         = "Test";
            b.PropertyType = typeof(double);
            b.DefaultValue = "Bad";
            b.Build();
        }
Esempio n. 16
0
            private PropertyInfo[] buildLeadershipSystemProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.LeadershipSystemName)
                .Append(x => x.LeadershipSystemDescription);
                return(exValues.Build());
            }
Esempio n. 17
0
            private PropertyInfo[] buildGiftCardsProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.GiftCodeEmailDraft)
                .Append(x => x.GiftCardMode);
                return(exValues.Build());
            }
Esempio n. 18
0
    private PropertyInfo[] BuildLevelCommission()
    {
        PropertyBuilder <MatrixCommissionLevel> builder = new PropertyBuilder <MatrixCommissionLevel>();

        builder.Append(x => x.CommissionLevel)
        .Append(x => x.Commission);

        return(builder.Build());
    }
        public void ItBuildsWithCorrectSetAccess()
        {
            var builder = new PropertyBuilder();

            builder.WithSetVisibility(AccessType.Public);

            var result = builder.Build();

            Assert.AreEqual(AccessType.Public, result.SetVisibility);
        }
Esempio n. 20
0
            private PropertyInfo[] buildMiniVideoProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.MiniVideoKeepDays)
                .Append(x => x.MiniVideoKeepForUserDays);

                return(exValues.Build());
            }
        public void ItBuildsWithCorrectType()
        {
            var builder = new PropertyBuilder();

            builder.WithType("FooBar");

            var result = builder.Build();

            Assert.AreEqual("FooBar", result.Type);
        }
Esempio n. 22
0
            private PropertyInfo[] buildTitanModulesProperties()
            {
                var paymentsValues = new PropertyBuilder <AppSettingsTable>();

                paymentsValues
                .Append(x => x.TitanProducts)
                .Append(x => x.TitanModules);

                return(paymentsValues.Build());
            }
Esempio n. 23
0
            private PropertyInfo[] buildCryptocurrencyTradingPlatformProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.CryptocurrencyCode)
                .Append(x => x.CryptocurrencySign);

                return(exValues.Build());
            }
Esempio n. 24
0
            private PropertyInfo[] buildTrafficExchangeProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.TimeBetweenAdsRedirectInSeconds)
                .Append(x => x.CreditBasedOnDurationEnabled)
                .Append(x => x.NumberOfAdsToWatchForcedByAdmin)
                .Append(x => x.NumberOfPointsPerWatchForcedByAdmin);
                return(exValues.Build());
            }
Esempio n. 25
0
        private PropertyInfo[] buildCustomFeatures()
        {
            PropertyBuilder <Member> paymentsValues = new PropertyBuilder <Member>();

            paymentsValues
            .Append(x => x.S4DSPackages)
            .Append(x => x.FirstActiveDayOfAdPacks)
            .Append(x => x.AdPackViewedCounter);

            return(paymentsValues.Build());
        }
Esempio n. 26
0
            private PropertyInfo[] buildSplashPageProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.SplashPageEnabled)
                .Append(x => x.SplashPageYoutubeUrl)
                .Append(x => x.SplashPageSlogan);

                return(exValues.Build());
            }
Esempio n. 27
0
            private PropertyInfo[] buildVacationModeProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.IsVacationModeEnabled)
                .Append(x => x.VacationModeCostPerDay)
                .Append(x => x.DaysToInactivityCharge)
                .Append(x => x.InactivityChargePerDay);
                return(exValues.Build());
            }
Esempio n. 28
0
            private PropertyInfo[] buildICOProperties()
            {
                var exValues = new PropertyBuilder <AppSettingsTable>();

                exValues
                .Append(x => x.ICOStartNewStageIfPreviousEndedEarlierEnabled)
                .Append(x => x.ICOPurchaseLimitPerUserPer15mins)
                .Append(x => x.ICOInformationHTML);

                return(exValues.Build());
            }
Esempio n. 29
0
        public void TestBuild_WithCompressor()
        {
            ICompressor     compressor = new DudCompressor();
            PropertyBuilder b          = new PropertyBuilder();

            b.Name         = "Test";
            b.PropertyType = typeof(double);
            b.Compressor   = compressor;
            Property p = b.Build();

            Assert.AreEqual(compressor.GetType(), p.Compressor.GetType());
        }
Esempio n. 30
0
        public void TestBuid_ValidDefaultValue()
        {
            object          defaultValue = 1d;
            PropertyBuilder b            = new PropertyBuilder();

            b.Name         = "Test";
            b.PropertyType = typeof(double);
            b.DefaultValue = defaultValue;
            Property p = b.Build();

            Assert.AreEqual(defaultValue, p.Value);
        }