public void btnEditScheduleReport_Click_WhenFtpListNotContainItems_FtpPanelIsNotShown() { //Arrange Initialize(); var schedulePopupShown = false; var toBeExported = DummyString; ShimModalPopupExtender.AllInstances.Show = (x) => { schedulePopupShown = true; }; ShimWizardSchedule.AllInstances.scheduleFtpExportGet = (x) => false; SetField(_wizardScheduleObject, "ftpExports", new List <string> { toBeExported }); SetField(_wizardScheduleObject, "lbFtpExports", new ListBox()); _methodArgs = new object[] { null, EventArgs.Empty }; //Act CallMethod( _wizardScheduleType, MethodEditScheduleClick, _methodArgs, _wizardScheduleObject); //Assert var ftpPanelShown = (GetField(_wizardScheduleObject, "pnlFtp") as Panel).Visible; _wizardScheduleObject.ShouldSatisfyAllConditions( () => ftpPanelShown.ShouldBeFalse(), () => schedulePopupShown.ShouldBeTrue()); }
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)); } }