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(); }
public void TestBuild_NoType() { PropertyBuilder b = new PropertyBuilder(); b.Name = "Test"; b.Build(); }
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()); }
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()); }
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()); }
public void TestBuild_NoName() { PropertyBuilder b = new PropertyBuilder(); b.PropertyType = typeof(string); b.Build(); }
private PropertyInfo[] buildPowerPacksProperties() { var paymentsValues = new PropertyBuilder <AppSettingsTable>(); paymentsValues .Append(x => x.PowerPacks); return(paymentsValues.Build()); }
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()); }
private PropertyInfo[] buildSSLProperties() { var paymentsValues = new PropertyBuilder <AppSettingsTable>(); paymentsValues .Append(x => x.SSLType); return(paymentsValues.Build()); }
private PropertyInfo[] buildSharesProperties() { var exValues = new PropertyBuilder <AppSettingsTable>(); exValues .Append(x => x.PorftolioSharesPolicyInt) .Append(x => x.SharesMarketSaleCommission); return(exValues.Build()); }
private PropertyInfo[] BuildInvestmentPlans() { PropertyBuilder <Member> builder = new PropertyBuilder <Member>(); builder.Append(x => x.InvestedIntoPlans) .Append(x => x.InvestedIntoPlansStructure); return(builder.Build()); }
public void TestBuild_PublicTypeNoConverter() { PropertyBuilder b = new PropertyBuilder(); b.Name = "Test"; b.PropertyType = typeof(double); b.PublicType = typeof(string); b.Build(); }
private PropertyInfo[] buildCommunicationProperties() { var exValues = new PropertyBuilder <AppSettingsTable>(); exValues .Append(x => x.TawkLiveChatKey) .Append(x => x.TawkLiveChatEnabled); return(exValues.Build()); }
public void TestBuild_BadDefaultValue() { PropertyBuilder b = new PropertyBuilder(); b.Name = "Test"; b.PropertyType = typeof(double); b.DefaultValue = "Bad"; b.Build(); }
private PropertyInfo[] buildLeadershipSystemProperties() { var exValues = new PropertyBuilder <AppSettingsTable>(); exValues .Append(x => x.LeadershipSystemName) .Append(x => x.LeadershipSystemDescription); return(exValues.Build()); }
private PropertyInfo[] buildGiftCardsProperties() { var exValues = new PropertyBuilder <AppSettingsTable>(); exValues .Append(x => x.GiftCodeEmailDraft) .Append(x => x.GiftCardMode); return(exValues.Build()); }
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); }
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); }
private PropertyInfo[] buildTitanModulesProperties() { var paymentsValues = new PropertyBuilder <AppSettingsTable>(); paymentsValues .Append(x => x.TitanProducts) .Append(x => x.TitanModules); return(paymentsValues.Build()); }
private PropertyInfo[] buildCryptocurrencyTradingPlatformProperties() { var exValues = new PropertyBuilder <AppSettingsTable>(); exValues .Append(x => x.CryptocurrencyCode) .Append(x => x.CryptocurrencySign); return(exValues.Build()); }
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()); }
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()); }
private PropertyInfo[] buildSplashPageProperties() { var exValues = new PropertyBuilder <AppSettingsTable>(); exValues .Append(x => x.SplashPageEnabled) .Append(x => x.SplashPageYoutubeUrl) .Append(x => x.SplashPageSlogan); return(exValues.Build()); }
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()); }
private PropertyInfo[] buildICOProperties() { var exValues = new PropertyBuilder <AppSettingsTable>(); exValues .Append(x => x.ICOStartNewStageIfPreviousEndedEarlierEnabled) .Append(x => x.ICOPurchaseLimitPerUserPer15mins) .Append(x => x.ICOInformationHTML); return(exValues.Build()); }
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()); }
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); }