Beispiel #1
0
        public void GivenBundleIsProcessed_WhenProcess_ThenThrowInvalidOperationException()
        {
            var bundle = new TestableBundle("~");

            bundle.Process(new CassetteSettings(""));

            Assert.Throws <InvalidOperationException>(
                () => bundle.Process(new CassetteSettings(""))
                );
        }
Beispiel #2
0
        public void WhenProcess_ThenIsProcessedIsTrue()
        {
            var bundle = new TestableBundle("~");

            bundle.Process(new CassetteSettings(""));
            bundle.IsProcessed.ShouldBeTrue();
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
 public void WhenProcess_ThenIsProcessedIsTrue()
 {
     var bundle = new TestableBundle("~");
     bundle.Process(new CassetteSettings(""));
     bundle.IsProcessed.ShouldBeTrue();
 }
Beispiel #5
0
        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);
            }
        }
Beispiel #6
0
        public void GivenBundleIsProcessed_WhenProcess_ThenThrowInvalidOperationException()
        {
            var bundle = new TestableBundle("~");
            bundle.Process(new CassetteSettings(""));

            Assert.Throws<InvalidOperationException>(
                () => bundle.Process(new CassetteSettings(""))
            );
        }