首页 \ 问答 \ unity 游戏设计模式与游戏完美开发 unity是版本多少

unity 游戏设计模式与游戏完美开发 unity是版本多少

更新时间:2019-05-06 22:09

最满意答案

如果被测程序、系统或对象,我们称之为A,那么Stub和Mock指的并不是A,而是测A的过程中,A需要与之交互的程序、系统或对象B。

Stub,也即“桩”,很早就有这个说法了,主要出现在集成测试的过程中,从上往下的集成时,作为下方程序的替代。作用如其名,就是在需要时,能够发现它存在,即可。就好像点名,“到”即可。

Mock,主要是指某个程序的傀儡,也即一个虚假的程序,可以按照测试者的意愿做出响应,返回被测对象需要得到的信息。也即是要风得风、要雨得雨、要返回什么值就返回什么值。

其他回答

同问。。。

相关问答

更多
  • 如果被测程序、系统或对象,我们称之为A,那么Stub和Mock指的并不是A,而是测A的过程中,A需要与之交互的程序、系统或对象B。 Stub,也即“桩”,很早就有这个说法了,主要出现在集成测试的过程中,从上往下的集成时,作为下方程序的替代。作用如其名,就是在需要时,能够发现它存在,即可。就好像点名,“到”即可。 Mock,主要是指某个程序的傀儡,也即一个虚假的程序,可以按照测试者的意愿做出响应,返回被测对象需要得到的信息。也即是要风得风、要雨得雨、要返回什么值就返回什么值。
  • 但是,我的测试时间增加了一倍,整个练习让我觉得完全毫无意义,因为我不再测试我的代码,我只是测试我的测试。 这里是关键。 不测试代码的测试没有用处。 如果你可以负面地改变你的测试应该测试的代码,并且测试不会失败,那么他们不值得拥有。 作为一个经验法则,除非必须,否则我不喜欢模拟/残缺任何东西。 例如,当我正在编写一个控制器测试时,我想确保在记录无法保存时发生相应的操作,我发现将对象的save方法save回为false会比较简单,而不是仔细地制作参数所以为了确保模型无法保存。 另一个例子是一个叫做admin?的 ...
  • 所有异步操作完成后,您需要调用完成。 你认为那是什么时候? 您通常会如何等待请求结束? it('Should test something.', function (done) { var req = someRequest, mock = sinon.mock(response), stub = sinon.stub(someObject, 'method'); // returns a promise stub.withArgs('foo').ret ...
  • 你应该stub : let(user) { double('user') } # if you don't need real user # or let(user) { create(:user) } # if you need real user before { allow_any_instance_of(Dashboard).to receive(:current_user) { user } } you should stub it: let(user) { double('user') } ...
  • 注意:我将在以后的段落中过度简化,甚至可能略有歪曲。 有关更多详细信息,请参阅Martin Fowler的网站 。 一个模拟是一个虚拟类,替换一个真实的类,为每个方法调用返回一个null或0。 如果您需要复杂类的虚拟实例,否则将使用模拟,否则将使用外部资源(如网络连接,文件或数据库)或可能使用数十种其他对象。 模拟的优点是可以将被测试类与系统的其余部分隔离开来。 一个存根也是一个虚拟类,为某些被测试的请求提供了一些更具体,准备或预先记录的重播结果。 你可以说一个存根是一个花哨的模拟。 在Spock中,您将经 ...
  • location = mock.tap { |loc| loc.should_receive(:build) } location = mock.tap { |loc| loc.should_receive(:build) }
  • 也许你可以用Arquillian解决这个问题: http ://arquillian.org/features/ 从网页: Arquillian将您的测试带到运行时,使您可以访问容器资源,有意义的反馈以及有关代码如何工作的洞察力。 Maybe you can solve this with Arquillian: http://arquillian.org/features/ From the web page: Arquillian brings your test to the runtime, giv ...
  • 您可以检查是否在“超级”类上调用该方法 ActionDispatch::Integration.any_instance.should_receive(:post) 由于ApiDock仅用于测试,因此您也可以使用alias_method_chain覆盖post方法: ActionDispatch::Integration.instance_eval do def post_with_apidoc(path, parameters = nil, headers = nil) post_witho ...
  • 我找到了解决方案。 我只需要在测试时将空虚函数作为道具传递。 test('Controls => should render pause button when countdownStatus equals started', (t: Object) => { t.plan(1) const wrapper: Object = shallow( {}}/>) const paus ...
  • 在Elixir和Erlang中有一些模拟解决方案,但它们并没有被大量使用。 如果您对此感兴趣,请参阅以下文章: http : //blog.29steps.co.uk/post/105715556278/testing-api-web-calls-in-elixir-using-meck 老实说,我会避免嘲笑。 如果你有一个API,测试返回的ID是一个UUID(你可以看看Ecto.UUID.dump(uuid)返回{:ok, something} )。 如果它是一个浏览器/ html应用程序,你很可能更关心 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。