public void InstanceBlockWorksWhenTypeRequested() { var blk = new InstanceBlock(typeof(string)); blk.WithType(); Check.That(blk.GetMessage()).IsEqualTo("an instance of type: [string]"); }
public void InstanceBlockShouldThrowOnHashcode() { Check.ThatCode(() => { var blk = new InstanceBlock(typeof(string)); blk.WithHashCode(); }) .Throws <NotSupportedException>().WithMessage("Cannot use hash code for generic instance description!"); }
public void InstanceBlockShouldThrowOnForceType() { Check.ThatCode(() => { var blk = new InstanceBlock(typeof(string)); blk.WithType(typeof(string)); }) .Throws <NotSupportedException>(); }
public void InstanceBlockShouldThrowOnEnumeration() { Check.ThatCode(() => { var blk = new InstanceBlock(typeof(string)); blk.WithEnumerableCount(0); }) .Throws <NotSupportedException>(); }
public void ShouldWorkForInstance() { var blk = new InstanceBlock(typeof(string)); Assert.AreEqual("an instance of type: [string]", blk.GetMessage()); }
public void InstanceBlockShouldThrowOnForceType() { Check.ThatCode(() => { var blk = new InstanceBlock(typeof(string)); blk.WithType(typeof(string)); }) .Throws<NotSupportedException>(); }
public void InstanceBlockShouldThrowOnEnumeration() { Check.ThatCode(() => { var blk = new InstanceBlock(typeof(string)); blk.WithEnumerableCount(0); }) .Throws<NotSupportedException>(); }
public void InstanceBlockShouldThrowOnEnumeration() { var blk = new InstanceBlock(typeof(string)); blk.WithEnumerableCount(0); }
public void InstanceBlockShouldThrowOnForceType() { var blk = new InstanceBlock(typeof(string)); blk.WithType(typeof(string)); }
public void InstanceBlockShouldThrowOnhashcode() { var blk = new InstanceBlock(typeof(string)); blk.WithHashCode(); }