Tag: 生成测试

C#中的FsCheck:生成具有相同形状的二维数组的列表

假设我正在为video分析编写一些代码。 以下是Video类的简化版本: public class Video { public readonly int Width; public readonly int Height; public readonly List Frames; public Video(int width, int height, IEnumerable frames) { Width = width; Height = height; Frames = new List(); foreach (var frame in frames) { if (frame.GetLength(0) != height || frame.GetLength(1) != width) { throw new ArgumentException(“Incorrect frames […]