zoukankan      html  css  js  c++  java
  • EntityFramework 用Moles的mock

    Notice: 当constructor为private的时候,new MXxxxxxx().Instance , 否则就可以直接new, 但要moles constructor


    using
    System.Data.Objects.Moles; public void GetProjectInfoTest() { MXTRACHoldingDBEntities.AllInstances.GetProjectSettingString = (obj, fileName) => { MObjectResult01<ProjectInfo> result = new MObjectResult01<ProjectInfo>(); result.Bind( new List<ProjectInfo>() { new ProjectInfo() { ProjectName = "Project", ProjectDescription = "Description", //other properties } }); return result.Instance; }; //other codes and Assert }
  • 相关阅读:
    滚动条滚动方向
    阶乘函数-尾递归
    返回顶部
    CommonJS
    vuessr
    随机字符串
    indexedDB
    深层次选择器
    Vue3.0简单替代Vuex
    shell 学习笔记
  • 原文地址:https://www.cnblogs.com/DelPiero/p/2719863.html
Copyright © 2011-2022 走看看