private void Initialize(string method = "default") { _wizardScheduleType = typeof(WizardSchedule); _wizardScheduleObject = CreateInstance(_wizardScheduleType); _sampleId = 0; _methodArgs = new object[] { _sampleId }; _chkCacheBuster = new CheckBox(); _chkboxConvTracking = new CheckBox(); _chkOptOutMasterSuppression = new CheckBox(); _chkOptOutSpecificGroup = new CheckBox(); _chkboxGoogleAnalytics = new CheckBox(); _chkboxOmnitureTracking = new CheckBox(); _txtCampaignSource = new TextBox(); _gvOptOutGroups = new GridView(); _pnlGoogleAnalytics = new Panel(); _pnlOmniture = new Panel(); _pnlOptOutSpecificGroups = CreateInstance(typeof(UpdatePanel)); _pnlOptOutSpecificGroups.UpdateMode = UpdatePanelUpdateMode.Conditional; _drpCampaignSource = new DropDownList(); CreateShims(method); InitializeControls(_wizardScheduleObject); SetDefaults(); if (method == MethodSetupScheduler) { InitializeSession(); _queryString = new NameValueCollection(); SetField(_wizardScheduleObject, "BlastScheduler1", new BlastScheduler()); } }
protected override void SetPageSessionContext() { base.SetPageSessionContext(); _testEntity = new WizardSchedule { CampaignItemID = 1 }; _privateTestObject = new PrivateObject(_testEntity); InitializeAllControls(_testEntity); InitializeSessionFakes(); }
protected override void SetPageSessionContext() { base.SetPageSessionContext(); _wizardSchedule = new WizardSchedule(); _privateObject = new PrivateObject(_wizardSchedule); InitializeAllControls(_wizardSchedule); _blastScheduler = new BlastScheduler(); InitializeAllControls(_blastScheduler); _privateObjectBlastScheduler = new PrivateObject(_blastScheduler); _privateObject.SetFieldOrProperty(BlastScheduler, _blastScheduler); _testGroupExplorer = new testGroupExplorer(); InitializeAllControls(_testGroupExplorer); _privateObjectTestGroupExplorer = new PrivateObject(_testGroupExplorer); _privateObject.SetFieldOrProperty(TestgroupExplorer, _testGroupExplorer); }
public void CcList_DefaultValueSetValue_ExpectDefaultEmptyListAndSetValue() { // Arrange using (var testObject = new WizardSchedule()) { // Act var defaultValue = testObject.ccList; testObject.ccList = new List <string> { TestValue }; // Assert testObject.ShouldSatisfyAllConditions( () => defaultValue.ShouldBeEmpty(), () => testObject.ccList.Count.ShouldBe(1), () => testObject.ccList[0].ShouldBe((TestValue))); } }
public void StringProperties_DefaultValueSetValue_ReturnsEmptyStringOrSetValue(string propertyName) { // Arrange using (var testObject = new WizardSchedule()) { var privateObject = new PrivateObject(testObject); Func <string> getPropertyValue = () => (string)privateObject.GetFieldOrProperty(propertyName); // Act var defaultValue = getPropertyValue(); privateObject.SetFieldOrProperty(propertyName, TestValue); // Assert testObject.ShouldSatisfyAllConditions( () => defaultValue.ShouldBeEmpty(), () => getPropertyValue().ShouldBe(TestValue)); } }