本文整理汇总了C#中NUnit.Framework.Between方法的典型用法代码示例。如果您正苦于以下问题:C# NUnit.Framework.Between方法的具体用法?C# NUnit.Framework.Between怎么用?C# NUnit.Framework.Between使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NUnit.Framework
的用法示例。
在下文中一共展示了NUnit.Framework.Between方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: a_slice_has_a_length
public void a_slice_has_a_length()
{
var array = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var slice = array.Between(0).And(4);
Assert.That(slice.Length, Is.EqualTo(5));
}
示例2: a_slice_contains_all_elements_between_start_and_end_of_the_array
public void a_slice_contains_all_elements_between_start_and_end_of_the_array()
{
var array = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var slice = array.Between(3).And(9);
Assert.That(slice, Is.EquivalentTo(new[] { 3, 4, 5, 6, 7, 8 }));
}
示例3: a_slice_can_be_accessed_by_an_index
public void a_slice_can_be_accessed_by_an_index()
{
var array = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var slice = array.Between(3).And(9);
Assert.That(slice[0], Is.EqualTo(3));
Assert.That(slice[4], Is.EqualTo(7));
}
示例4: altering_an_element_in_a_slice_will_alter_the_element_in_the_original_array
public void altering_an_element_in_a_slice_will_alter_the_element_in_the_original_array()
{
var array = new[] { new TestClass(), new TestClass(), new TestClass() };
var slice = array.Between(0).And(2);
slice[1].Value = "altered";
Assert.That(array[1].Value, Is.EqualTo("altered"));
}
示例5: a_slice_can_be_enumerated_over
public void a_slice_can_be_enumerated_over()
{
var array = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var slice = array.Between(3).And(9);
int expectedIndex = 0;
foreach (var element in slice)
{
Assert.That(element, Is.EqualTo(slice[expectedIndex]));
expectedIndex++;
}
}