public void GivenBundleIsProcessed_WhenProcess_ThenThrowInvalidOperationException() { var bundle = new TestableBundle("~"); bundle.Process(new CassetteSettings("")); Assert.Throws <InvalidOperationException>( () => bundle.Process(new CassetteSettings("")) ); }
public void WhenProcess_ThenIsProcessedIsTrue() { var bundle = new TestableBundle("~"); bundle.Process(new CassetteSettings("")); bundle.IsProcessed.ShouldBeTrue(); }
public void OpenStreamReturnsSingleAssetOpenStreamResult() { var bundle = new TestableBundle("~"); var asset = new Mock <IAsset>(); using (var stream = new MemoryStream()) { asset.Setup(a => a.OpenStream()).Returns(stream); bundle.Assets.Add(asset.Object); bundle.Process(new CassetteSettings("")); var actualStream = bundle.OpenStream(); actualStream.ShouldBeSameAs(stream); } }
public void WhenProcess_ThenIsProcessedIsTrue() { var bundle = new TestableBundle("~"); bundle.Process(new CassetteSettings("")); bundle.IsProcessed.ShouldBeTrue(); }
public void OpenStreamReturnsSingleAssetOpenStreamResult() { var bundle = new TestableBundle("~"); var asset = new Mock<IAsset>(); using (var stream = new MemoryStream()) { asset.Setup(a => a.OpenStream()).Returns(stream); bundle.Assets.Add(asset.Object); bundle.Process(new CassetteSettings("")); var actualStream = bundle.OpenStream(); actualStream.ShouldBeSameAs(stream); } }
public void GivenBundleIsProcessed_WhenProcess_ThenThrowInvalidOperationException() { var bundle = new TestableBundle("~"); bundle.Process(new CassetteSettings("")); Assert.Throws<InvalidOperationException>( () => bundle.Process(new CassetteSettings("")) ); }