当前位置: 首页>>代码示例>>C#>>正文


C# ContextMocks.GetHtmlHelper方法代码示例

本文整理汇总了C#中ContextMocks.GetHtmlHelper方法的典型用法代码示例。如果您正苦于以下问题:C# ContextMocks.GetHtmlHelper方法的具体用法?C# ContextMocks.GetHtmlHelper怎么用?C# ContextMocks.GetHtmlHelper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContextMocks的用法示例。


在下文中一共展示了ContextMocks.GetHtmlHelper方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IntPropertyDefault

        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);
        }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例2: DateTimePropertyEdit

        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);
        }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例3: OneRefParameterPopulatedActionAsDialog

        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);
        }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例4: RefPropertyStringEditExistingValue

        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);
        }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例5: TestClientValidationHtml

        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);
        }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例6: TestClientValidationHtmlDialog

        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);
        }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例7: NullableBoolParameter

        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);
        }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例8: ParameterWithHint

        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);
        }
开发者ID:,项目名称:,代码行数:12,代码来源:

示例9: NotPersistedPropertyList

        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);
        }
开发者ID:,项目名称:,代码行数:12,代码来源:

示例10: MultiLineParameter

        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);
        }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例11: MultiLineFieldView

        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);
        }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例12: DuplicateAction

        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);
        }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例13: DisplayName

 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);
 }
开发者ID:,项目名称:,代码行数:7,代码来源:


注:本文中的ContextMocks.GetHtmlHelper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。