草庐IT

test_key

全部标签

testing - 在小部件测试期间,如何 stub 不属于类的函数?

我正在创建一个flutter应用程序,它使用原生相机拍照,使用官方的flutter相机包(https://pub.dev/packages/camera)。该应用程序打开一个模式,该模式根据包中availableCameras函数的结果加载CameraPreview和拍摄照片的FloatingActionButton按下时。在为此模式创建小部件测试时,我不知道如何stubavailableCameras函数以在测试期间返回我想要的内容。我尝试使用Mockito测试包,但这只支持模拟类。由于此函数不属于某个类,因此我无法模拟它。availableCameras函数返回设备拥有的摄像头列表

testing - 在小部件测试期间,如何 stub 不属于类的函数?

我正在创建一个flutter应用程序,它使用原生相机拍照,使用官方的flutter相机包(https://pub.dev/packages/camera)。该应用程序打开一个模式,该模式根据包中availableCameras函数的结果加载CameraPreview和拍摄照片的FloatingActionButton按下时。在为此模式创建小部件测试时,我不知道如何stubavailableCameras函数以在测试期间返回我想要的内容。我尝试使用Mockito测试包,但这只支持模拟类。由于此函数不属于某个类,因此我无法模拟它。availableCameras函数返回设备拥有的摄像头列表

unit-testing - Fluent NHibernate - HiLo 方案的 PersistenceSpecification

不确定我问的问题是否正确,所以请多多包涵!一点NHibernate新手。我们正在使用FluentNH并且所有表都有以下id生成方案publicclassIdGenerationConvention:IIdConvention{publicvoidApply(IIdentityInstanceinstance){varwhere=string.Format("TableKey='{0}'",instance.EntityType.Name);instance.GeneratedBy.HiLo("HiloPrimaryKeys","NextHighValue","1000",x=>x.Ad

unit-testing - Fluent NHibernate - HiLo 方案的 PersistenceSpecification

不确定我问的问题是否正确,所以请多多包涵!一点NHibernate新手。我们正在使用FluentNH并且所有表都有以下id生成方案publicclassIdGenerationConvention:IIdConvention{publicvoidApply(IIdentityInstanceinstance){varwhere=string.Format("TableKey='{0}'",instance.EntityType.Name);instance.GeneratedBy.HiLo("HiloPrimaryKeys","NextHighValue","1000",x=>x.Ad

python - Django 2.0 : sqlite IntegrityError: FOREIGN KEY constraint failed

我正在努力为django-pagetree添加Django2.0支持图书馆。在自动化测试期间,使用sqlite内存数据库,我遇到了一堆这样的错误:File"/home/nnyby/src/django-pagetree/pagetree/tests/test_models.py",line638,insetUp'children':[],File"/home/nnyby/src/django-pagetree/pagetree/models.py",line586,inadd_child_section_from_dict...File"/home/nnyby/src/django-p

python - Django 2.0 : sqlite IntegrityError: FOREIGN KEY constraint failed

我正在努力为django-pagetree添加Django2.0支持图书馆。在自动化测试期间,使用sqlite内存数据库,我遇到了一堆这样的错误:File"/home/nnyby/src/django-pagetree/pagetree/tests/test_models.py",line638,insetUp'children':[],File"/home/nnyby/src/django-pagetree/pagetree/models.py",line586,inadd_child_section_from_dict...File"/home/nnyby/src/django-p

unit-testing - FluentNhibernate 和 SQLite

我无法让SQLite驱动程序在我的session工厂中工作。我从http://sqlite.phxsoftware.com/下载了SQLite1.0.48我在我的测试项目中添加了对System.Data.SQLite的引用。publicstaticIPersistenceConfigurerGetSqlLiteConfigurer(){try{returnSQLiteConfiguration.Standard.InMemory();}catch(Exceptionex){throwex;}}这就是我生成配置器的方式问题是当我构建session工厂时出现以下错误:NHibernate.

unit-testing - FluentNhibernate 和 SQLite

我无法让SQLite驱动程序在我的session工厂中工作。我从http://sqlite.phxsoftware.com/下载了SQLite1.0.48我在我的测试项目中添加了对System.Data.SQLite的引用。publicstaticIPersistenceConfigurerGetSqlLiteConfigurer(){try{returnSQLiteConfiguration.Standard.InMemory();}catch(Exceptionex){throwex;}}这就是我生成配置器的方式问题是当我构建session工厂时出现以下错误:NHibernate.

android - 什么是最好的 : 1 table per record or 1 table with all records linked with foreign keys?

我有一个应用程序可以让用户创建不同的表单(调查)然后填写它们。(因此它可以替代纸张)。这是我在应用中使用的当前模型:Table1)+-------------------------+|SURVEYSTABLE|+----+------+-------------+|ID|name|description|+----+------+-------------+Table2)+-----------------------------------+|$[name_of_the_survey]|+----+-------+------+-------+-------+|ID|field|t

android - 什么是最好的 : 1 table per record or 1 table with all records linked with foreign keys?

我有一个应用程序可以让用户创建不同的表单(调查)然后填写它们。(因此它可以替代纸张)。这是我在应用中使用的当前模型:Table1)+-------------------------+|SURVEYSTABLE|+----+------+-------------+|ID|name|description|+----+------+-------------+Table2)+-----------------------------------+|$[name_of_the_survey]|+----+-------+------+-------+-------+|ID|field|t