本文整理汇总了C#中BlockType.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# BlockType.Clone方法的具体用法?C# BlockType.Clone怎么用?C# BlockType.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlockType
的用法示例。
在下文中一共展示了BlockType.Clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldCloneObject
public void ShouldCloneObject()
{
var blockType = new BlockType();
blockType.Blocks.Add(new Block());
var result = blockType.Clone() as BlockType;
Assert.NotNull( result );
Assert.NotNull( result.Blocks );
Assert.IsNotEmpty( result.Blocks );
}
示例2: Clone
public void Clone()
{
var blockType = new BlockType();
blockType.Blocks.Add( new Block() );
var result = blockType.Clone() as BlockType;
Assert.NotNull( result );
// TODO: Fix Clone() to include all child objects
//Assert.NotNull( result.Blocks );
//Assert.NotEmpty( result.Blocks );
}
示例3: ShouldCopyProperties
public void ShouldCopyProperties()
{
var blockType = new BlockType { Name = "some block type" };
var result = blockType.Clone( false );
Assert.AreEqual( result.Name, blockType.Name );
}
示例4: ShallowClone
public void ShallowClone()
{
var blockType = new BlockType { Name = "some block type" };
var result = blockType.Clone( false );
Assert.Equal( result.Name, blockType.Name );
}