The Unlicense

项目介绍

stijnmoreels/FScenario 是一个托管在 GitHub 上的开源项目,主要使用 F# 编写,采用 The Unlicense 许可证,目前获得 10 个 Star、2 次 Fork。

仓库全名
stijnmoreels/FScenario
开源许可证
The Unlicense
Star 数
10
Fork 数
2
未关闭 Issue
1

README 摘要

FScenario FScenario is a .NET project to help developers writing more safe integration tests but also to make the developing more fun. The project contains several ways to help the developer to clean up in after the integration test has run, polling mechanisms to make the assertion phase more reliable, building blocks to create your own disposable fixture, ... Information Following resources contains some extra…

完整内容见 GitHub 原始 README 或本页 。

常见问题

FScenario 用什么语言开发?

主要使用 F# 编写,采用 The Unlicense 许可证,目前有 10 个 Star。

FScenario 可以免费商用吗?

仓库采用 The Unlicense 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 FScenario 的源码?

可以直接克隆仓库:git clone https://github.com/stijnmoreels/FScenario.git,默认分支为 main;安装与运行步骤见仓库 README。

FScenario 最近还在维护吗?

仓库最近一次更新为 2022年11月26日,当前有 1 个未关闭 Issue;Star 数为 10,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Reusable integration test building blocks to make writing integration tests more fun.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

Batchfile
C#
F#
HTML
Shell

贡献者

README

FScenario

FScenario is a .NET project to help developers writing more safe integration tests but also to make the developing more fun. The project contains several ways to help the developer to clean up in after the integration test has run, polling mechanisms to make the assertion phase more reliable, building blocks to create your own disposable fixture, …

logo

Information

Following resources contains some extra information about this library:

NuGet

NuGet Badge

Build Status

Mono .NET
Mono CI Build Status .NET Build status

Examples

The project exposes several reusable building blocks to make your integration/scenario test more reliable in seconds.

Several test fixtures to test file system related functionality:

open System.IO
open Expecto
open FScenario

let startYourApplication = ignore

[<Tests>]
let file_tests =
    testCaseAsync "should poll for file presence" <| async {
      Dir.clean "."
      do startYourApplication
      let! f = Poll.untilFileExistsEvery1sFor5s "some-file.txt"
      FileInfo.delete f
};

Several test fixtures to test HTTP functionality or HTTP callbacks from your applications without any big setup.

open Expecto
open FScenario

[<Tests>]
let http_tests =
    testCaseAsync "starts http server and GET -> OK" <| async {
        let endpoint = "http://localhost:8080"
        use _ = Http.server endpoint
        do! Poll.untilHttpOkEvery1sFor5s endpoint
        use! res = Http.get endpoint
        Expect.equal OK res.StatusCode "http status code should be OK"
    };

And a lot more building blocks that are written in such a generic way, you can use it anywhere.

async {
    do! Poll.target (fun () -> async { return Dir.files "my-dir" })
        |> Poll.until (Seq.length >> (=) 3)
        |> Poll.every _1s
        |> Poll.timeout _10s
        |> Poll.error "Directory 'my-dir' should have 3 files" }

With full C# support!

Poll.Target(() => Task.FromResult(Dir.Files("my-dir")))
    .Until(fs => fs.Length == 3)
    .Every(TimeSpans._1s)
    .For(TimeSpans._10s)
    .Error("Directory 'my-dir' should have 3 files);

评论

暂无评论