本文整理汇总了C#中Group.MapWith方法的典型用法代码示例。如果您正苦于以下问题:C# Group.MapWith方法的具体用法?C# Group.MapWith怎么用?C# Group.MapWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Group
的用法示例。
在下文中一共展示了Group.MapWith方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestTransformedWith
public void TestTransformedWith()
{
var a = new Group(new int[]{2, 4, 6, 8});
var b = new Group(new int[]{2, 8});
var map = b.MapWith(a);
Assert.True(map.Length == 4);
Assert.True(map[0] == 0);
Assert.True(map[1] == 1);
Assert.True(map[2] == 2);
Assert.True(map[3] == 3);
var c = Group.FromOrderedMap(map);
Assert.True(c.Count == 2);
Assert.True(c[0] == 0);
Assert.True(c[1] == 4);
c = b.TransformedWith(a);
Assert.True(c.Count == 2);
Assert.True(c[0] == 0);
Assert.True(c[1] == 4);
}
示例2: TestMapWith
public void TestMapWith()
{
var items = new string[]{"0", "1", "2", "3", "4", "5", "6", "7"};
var a = new Group(new int[]{3, 8});
var b = new Group(new int[]{2, 5, 7, 8});
var aItems = a.MapTo<string>(items);
// Create a map of b in the internal space of a.
var map = b.MapWith(a);
Assert.True(map.Length == 3);
Assert.True(map[0] == 0);
Assert.True(map[1] == 1);
Assert.True(map[2] == 4);
Assert.True(aItems[map[0]] == "3");
Assert.True(aItems[map[1]] == "4");
Assert.True(aItems[map[2]] == "7");
}