简体   繁体   English

使用颤振作用域模型进行单元测试

[英]Unit testing with flutter scoped model

Developing an app I end up with some logic in my scoped model.开发一个应用程序我最终在我的范围模型中得到了一些逻辑。 My search does not show any examples on unit testing.我的搜索没有显示任何关于单元测试的例子。 Does anyone have an experience with in writing a test for scoped model?有没有人有编写范围模型测试的经验? How can I mock lifecycle of the scoped model?如何模拟作用域模型的生命周期?

Not exactly sure of what you mean by the lifecycle...不完全确定你所说的生命周期是什么意思......

But if you want to test Model startup, state changes and rebuilds of widgets (via Scoped Model) you should have a look at the actual unit tests of the Scoped Model repository.但是,如果您想测试模型启动、状态更改和小部件的重建(通过 Scoped Model),您应该查看 Scoped Model 存储库的实际单元测试。

Some good examples in there...那里有一些很好的例子......

Scoped Model's unit tests 范围模型的单元测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM