• Consider the benefits of the automocking feature over creating mocks for all dependencies of a class.
  • This feature is a part of the fastest, most flexible and complete mocking tool for crafting unit tests.
  • Our award-winning support team is dedicated to assisting you with any questions and issues you may have during your application development.
  • "> 自动锁定-模拟功能| Telerik JustMock - 万博ManBetX体验网址

    teleerik JustMock

    Automocking

    • 考虑一下自动锁定特性相对于为类的所有依赖项创建模拟的好处。
    • 这个特性是制作单元测试的最快、最灵活、最完整的模拟工具的一部分。
    • 我们屡获殊荣的支持团队致力于帮助您解决应用程序开发过程中可能遇到的任何问题和问题。
    mock和Assert功能
    Nasa, Visa,微软 福克斯,三星,IBM 世界银行集团,沃尔沃
    • Automocking概述

      自动锁定允许您创建类的实例,而不必显式地将每个单独的依赖项创建为唯一的mock。如果您需要作为测试的一部分重新安排方法或属性,那么模拟的依赖项仍然可用。
      自动锁定最适合处理具有多个依赖项的复杂类或随时间变化的类。为这些类的成员编写的测试通常不需要显式地模拟所有依赖项,因为它们可能不会在测试逻辑中使用,但它们是类实例化所必需的。

      考虑一下自动锁定特性相对于为类的所有依赖项创建模拟的好处。

      
                    
      (TestMethod)
      公共无效ShouldMockDependenciesWithoutContainer ()
      {
      / /安排
      var firstDep = Mock.Create();
      var secondep = Mock.Create();
      var thirdDep = Mock.Create();
      var newInstance =Foo(firstDep, secondDep, thirdDep);
      Mock.Arrange(() => secondDep.GetString()). return ()“SomeExpectedString”);
      ….
      }
      (TestMethod)
      公共无效ShouldMockDependenciesWithoutContainer ()
      {
      / /安排
      Var容器=MockingContainer < ClassUnderTest > ();
      容器。安排< ISecondDependency > (
      secondDep => secondDep. getstring ()). return ()“SomeExpectedString”);
      ….
      }

      Automocking文档
    Background-NextSteps

    下一个步骤

    参见计划与定价

    购买单个产品或任何捆绑产品

    免费下载试用版

    有专门的技术支持。

    Baidu
    map