小编Ozz*_*zzy的帖子

React Native vs Swift/Objective-C/Java Native

我正在为Fintech公司开发一个新项目,我的任务是研究是否应该使用React Native或本地Swift/Objective-C/Java来实现我们的移动应用程序开发技术和战略.

我已经对此进行了大量的研究,并阅读了许多与React Native有关的案例研究,但我仍然觉得我没有足够的时间做出明智的决定.

广泛的应用功能将包括以下内容:

  • 帐户余额和报表等数据相关功能(非常简单)
  • 身份文件的图像捕获和用户的自拍
  • 捕获生物识别数据
  • 推送通知

其中一些非常标准和简单,但其中一些将要求应用程序使用低级设备功能和/或使用第三方Android和iOS SDK.

因此,在致力于移动开发策略的决策方面,我可以根据您最近的经验,请求您根据本机Swift/Objective-C/Java开发考虑React Native的原因.上面列出的计划功能(包括为什么坚持使用本地语言/平台可能更好的原因).

mobile-application react-native

16
推荐指数
2
解决办法
2790
查看次数

NSubstitute - 测试特定的linq表达式

我正在使用我正在开发的MVC 3应用程序中的存储库模式.我的存储库界面如下所示:

public interface IRepository<TEntity> where TEntity : IdEntity
{
    void Add(TEntity entity);
    void Update(TEntity entity);
    void Remove(TEntity entity);
    TEntity GetById(int id);
    IList<TEntity> GetAll();
    TEntity FindFirst(Expression<Func<TEntity, bool>> criteria);
    IList<TEntity> Find(Expression<Func<TEntity, bool>> criteria);
}
Run Code Online (Sandbox Code Playgroud)

在很多实例中,当我在服务类中编码方法时,我正在使用FindFirstFind方法.如您所见,它们都将linq表达式作为输入.我想知道的是,NSubstitute是否允许您在代码中指定要测试的特定表达式.

所以,这是一个服务方法的例子,它说明了我提到的一个Repository方法的使用:

public IList<InvoiceDTO> GetUnprocessedInvoices()
{
    try
    {
        var invoices = _invoiceRepository.Find(i => !i.IsProcessed && i.IsConfirmed);
        var dtoInvoices = Mapper.Map<IList<Invoice>, IList<InvoiceDTO>>(invoices);
        return dtoInvoices;
    }
    catch (Exception ex)
    {
        throw new Exception(string.Format("Failed to get unprocessed invoices: {0}", ex.Message), ex);
    }
}
Run Code Online (Sandbox Code Playgroud)

那么,有没有办法,使用NSubtitute,我可以测试特定的lamda表达式:i => …

c# unit-testing nsubstitute

10
推荐指数
3
解决办法
6630
查看次数

Telerik MVC Grid - 可以为空的DateTime属性的问题

我是Telerik MVC扩展的新手.我已成功在视图中实现了我的第一个实例.我没有使用Telerik MVC Grid实现我的第二个视图,但是绑定到网格的类有2列Nullable类型.当我运行我的代码时,视图会发出错误,如下所示:

传递到字典中的模型项为null,但此字典需要"System.DateTime"类型的非null模型项.

我原本以为这可能是一个渲染问题,模板只适用于DateTime而不是Nullable,但后来我完全取出了显示这些DataTime的任何列?属性.

我的代码如下:

查看Telerik MVC Grid的代码

<%= Html.Telerik().Grid(Model.ScheduledCourseList)
.Name("ScheduledCoursesGrid")
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image).ImageHtmlAttributes(new { style = "margin-left:0" }))
.DataKeys(keys => keys.Add(sc => sc.Id))
.DataBinding(dataBinding =>
    dataBinding.Ajax()
        .Select("_List", "Course")
        .Insert("_InsertAjax", "Course")
        .Update("_UpdateAjax", "Course")
        .Delete("_DeleteAjax", "Course")
)
.Columns(columns =>
{
    columns.Bound(c => c.Id).Width(20);
    //columns.Bound(c => c.ScheduledDateTime).Width(120);
    //columns.Bound(c => c.Location).Width(150);
    columns.Command(commands =>
    {
        commands.Edit().ButtonType(GridButtonType.Image);
        commands.Delete().ButtonType(GridButtonType.Image);
    }).Width(180).Title("Commands");
})
.Editable(editing => editing.Mode(GridEditMode.PopUp))
.Sortable()
.Footer(true) %>
Run Code Online (Sandbox Code Playgroud)

DTO

    public class ScheduledCourseDTO
{
    public int Id { get; set; }
    public int CourseId { get; …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc telerik-mvc

3
推荐指数
1
解决办法
6939
查看次数