草庐IT

c# - C# : generate a list of two dimension arrays with the same shape 中的 FsCheck

假设我正在编写一些视频分析代码。这是视频类的简化版本:publicclassVideo{publicreadonlyintWidth;publicreadonlyintHeight;publicreadonlyListFrames;publicVideo(intwidth,intheight,IEnumerableframes){Width=width;Height=height;Frames=newList();foreach(varframeinframes){if(frame.GetLength(0)!=height||frame.GetLength(1)!=width){thr

在FSCHECK中将两个发电机与单个任意组合结合

我有一个我想测试的财产Stuff,其中之一Stuff满足特定财产。我有一种产生的方法Stuff满足该财产,以及一种生成的方式Stuff那不是。今天,我正在做这样的事情(是的,我在C#中使用FSCHECK):IEnumerableGetStuffCollection(intinput){yieldreturnGenerateStuffSatisfyingProperty(input);yieldreturnGenerateStuffNotSatisfyingProperty(input);}[Fact]publicvoidPropertyForCollectionHolds(){Prop.For