本文整理汇总了C#中Cell.AddSpan方法的典型用法代码示例。如果您正苦于以下问题:C# Cell.AddSpan方法的具体用法?C# Cell.AddSpan怎么用?C# Cell.AddSpan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cell
的用法示例。
在下文中一共展示了Cell.AddSpan方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddSpan_ContainedMerge_Success
public void AddSpan_ContainedMerge_Success()
{
var cell = new Cell(40);
var span = new Span(10, 20);
var span2 = new Span(5, 25);
cell.AddSpan(span);
cell.AddSpan(span2);
Assert.AreEqual(span2.Minimum, cell.Spans[0].Minimum);
Assert.AreEqual(span2.Maximum, cell.Spans[0].Maximum);
}
示例2: AddSpan_Above_Success
public void AddSpan_Above_Success()
{
var cell = new Cell(40);
var span = new Span(10, 20);
var span2 = new Span(21, 25);
cell.AddSpan(span);
cell.AddSpan(span2);
Assert.AreEqual(span.Minimum, cell.Spans[0].Minimum);
Assert.AreEqual(span.Maximum, cell.Spans[0].Maximum);
Assert.AreEqual(span2.Minimum, cell.Spans[1].Minimum);
Assert.AreEqual(span2.Maximum, cell.Spans[1].Maximum);
}
示例3: AddSpan_First_Success
public void AddSpan_First_Success()
{
var cell = new Cell(40);
var span = new Span(10, 20);
cell.AddSpan(span);
Assert.AreEqual(span.Minimum, cell.Spans[0].Minimum);
Assert.AreEqual(span.Maximum, cell.Spans[0].Maximum);
}
示例4: AddSpan_Flipped_Success
public void AddSpan_Flipped_Success()
{
var cell = new Cell(40);
var span = new Span(20, 10);
cell.AddSpan(span);
Assert.AreEqual(cell.Spans[0].Minimum, span.Maximum);
Assert.AreEqual(cell.Spans[0].Maximum, span.Minimum);
}
示例5: Indexer_FindSpan_Success
public void Indexer_FindSpan_Success()
{
var cell = new Cell(10);
cell.AddSpan(new Span(2, 5));
cell.AddSpan(new Span(7, 9));
var span = cell[6];
Assert.IsNull(span);
}
示例6: Indexer_OutOfSpan_ReturnsNull
public void Indexer_OutOfSpan_ReturnsNull()
{
var cell = new Cell(10);
cell.AddSpan(new Span(2, 6));
var span = cell[1];
Assert.IsNull(span);
}
示例7: Indexer_InSpan_Success
public void Indexer_InSpan_Success()
{
var cell = new Cell(10);
cell.AddSpan(new Span(2, 6));
var span = cell[4];
Assert.AreEqual(2, span.Value.Minimum);
Assert.AreEqual(6, span.Value.Maximum);
}