public void IntPropertyDefault() { var mocks = new ContextMocks(controller); INakedObject adapter = FrameworkHelper.GetNakedObject(new CustomHelperTestClass()); mocks.ViewDataContainer.Object.ViewData.Model = adapter.Object; mocks.ViewDataContainer.Object.ViewData[IdHelper.NofServices] = FrameworkHelper.GetServices(); mocks.ViewDataContainer.Object.ViewData["CustomHelperTestClass-TestIntDefault-Input"] = PersistorUtils.CreateAdapter(0); string s = mocks.GetHtmlHelper<CustomHelperTestClass>().ObjectPropertyEdit(y => y.TestIntDefault).ToString(); CheckResults("TestIntDefault", s); }
public void DateTimePropertyEdit() { var mocks = new ContextMocks(controller); INakedObject adapter = FrameworkHelper.GetNakedObject(new NotPersistedTestClass()); mocks.ViewDataContainer.Object.ViewData.Model = adapter.Object; mocks.ViewDataContainer.Object.ViewData[IdHelper.NofServices] = FrameworkHelper.GetServices(); string s = mocks.GetHtmlHelper<NotPersistedTestClass>().ObjectPropertyEdit(y => y.TestDateTime).ToString(); CheckResults("TestDateTime", s); }
public void OneRefParameterPopulatedActionAsDialog() { var mocks = new ContextMocks(controller); var tc = (CustomHelperTestClass)GetTestService("Custom Helper Test Classes").GetAction("New Instance").InvokeReturnObject().NakedObject.Object; mocks.ViewDataContainer.Object.ViewData.Model = tc; mocks.ViewDataContainer.Object.ViewData[IdHelper.NofServices] = FrameworkHelper.GetServices(); mocks.ViewDataContainer.Object.ViewData["CustomHelperTestClass-OneRefParameterAction-Parm-Select"] = PersistorUtils.CreateAdapter(tc); string s = mocks.GetHtmlHelper<CustomHelperTestClass>().ObjectActionAsDialog<CustomHelperTestClass, CustomHelperTestClass>(y => y.OneRefParameterAction).ToString(); CheckResults("OneRefParameterPopulatedActionAsDialog", s); }
public void RefPropertyStringEditExistingValue() { var mocks = new ContextMocks(controller); var tc = (CustomHelperTestClass)GetTestService("Custom Helper Test Classes").GetAction("New Instance").InvokeReturnObject().NakedObject.Object; mocks.ViewDataContainer.Object.ViewData.Model = tc; mocks.ViewDataContainer.Object.ViewData[IdHelper.NofServices] = FrameworkHelper.GetServices(); var id = FrameworkHelper.GetObjectId(tc); mocks.ViewDataContainer.Object.ViewData.ModelState.SetModelValue("CustomHelperTestClass-TestRef-Select", new ValueProviderResult(id, null, null)); string s = mocks.GetHtmlHelper<CustomHelperTestClass>().ObjectPropertyEdit("TestRef").ToString(); CheckResults("RefPropertyStringEditExistingValue", s); }
public void TestClientValidationHtml() { var mocks = new ContextMocks(controller); mocks.ViewDataContainer.Object.ViewData.Model = DescribedTestClass; string s = mocks.GetHtmlHelper<DescribedCustomHelperTestClass>().PropertyListEdit(mocks.ViewDataContainer.Object.ViewData.Model).ToString(); CheckResults("ClientValidationHtml", s); }
public void TestClientValidationHtmlDialog() { var mocks = new ContextMocks(controller); mocks.ViewDataContainer.Object.ViewData.Model = DescribedTestClass; string s = mocks.GetHtmlHelper<DescribedCustomHelperTestClass>().ObjectActionAsDialog<DescribedCustomHelperTestClass, string, int, string, string>(DescribedTestClass, x => x.TestClientValidationFunction).ToString(); CheckResults("ClientValidationHtmlDialog", s); }
public void NullableBoolParameter() { var mocks = new ContextMocks(controller); var btc = new BoolTestClass(); mocks.ViewDataContainer.Object.ViewData.Model = btc; PersistorUtils.CreateAdapter(btc); string s = mocks.GetHtmlHelper<BoolTestClass>().ObjectActionAsDialog<BoolTestClass, bool?>(btc, x => x.TestNullableBoolAction).ToString(); CheckResults("NullableBoolParameter", s); }
public void ParameterWithHint() { var mocks = new ContextMocks(controller); var hint = (HintTestClass)GetBoundedInstance<HintTestClass>("HintTestClass").GetDomainObject(); mocks.ViewDataContainer.Object.ViewData.Model = hint; mocks.ViewDataContainer.Object.ViewData[IdHelper.NofServices] = FrameworkHelper.GetServices(); FrameworkHelper.GetNakedObject(hint); string s = mocks.GetHtmlHelper<HintTestClass>().ObjectActionAsDialog<HintTestClass, int, int>(hint, x => x.ActionWithParms).ToString(); CheckResults("ParameterWithHint", s); }
public void NotPersistedPropertyList() { var mocks = new ContextMocks(controller); INakedObject adapter = FrameworkHelper.GetNakedObject(NotPersistedTestClass); mocks.ViewDataContainer.Object.ViewData.Model = adapter.Object; string s = mocks.GetHtmlHelper<NotPersistedTestClass>().PropertyList(adapter.Object).ToString(); CheckResults("NotPersistedPropertyList", s); }
public void MultiLineParameter() { var mocks = new ContextMocks(controller); mocks.ViewDataContainer.Object.ViewData.Model = DescribedTestClass; string s = mocks.GetHtmlHelper<DescribedCustomHelperTestClass>().ObjectActionAsDialog<DescribedCustomHelperTestClass, string>(DescribedTestClass, x => x.TestMultiLineFunction).ToString(); CheckResults("MultilineParameter", s); }
public void MultiLineFieldView() { var mocks = new ContextMocks(controller); DescribedCustomHelperTestClass tc = DescribedTestClass; tc.TestMultiLineString = "Test String"; mocks.ViewDataContainer.Object.ViewData.Model = tc; string s = mocks.GetHtmlHelper<DescribedCustomHelperTestClass>().PropertyListWith(tc, x => x.TestMultiLineString).ToString(); CheckResults("MultilineFieldView", s); }
public void DuplicateAction() { var mocks = new ContextMocks(controller); mocks.ViewDataContainer.Object.ViewData[IdHelper.NofServices] = FrameworkHelper.GetServices(); var testBool = (BoolTestClass)GetBoundedInstance<BoolTestClass>("BoolClass").GetDomainObject(); string s = mocks.GetHtmlHelper<BoolTestClass>().Menu(testBool).ToString(); CheckResults("DuplicateAction", s); }
public void DisplayName() { var mocks = new ContextMocks(controller); mocks.ViewDataContainer.Object.ViewData.Model = DescribedTestClass; string s = mocks.GetHtmlHelper<DescribedCustomHelperTestClass>().Menu(DescribedTestClass).ToString(); CheckResults("DisplayName", s); }