public void Minify_DebuggerAttached() { // Arrange var debugger = Mocks.Create<IDebugger>(); debugger.Setup(d => d.IsAttached).Returns(true); var fullContent = "full"; var minifiedContent = "minified"; var minifier = new Minifier(debugger.Object, null); // Act var result = minifier.Minify(fullContent, minifiedContent); // Assert Assert.That(result, Is.EqualTo(fullContent), "The content should not be minified because the debugger is attached."); Mocks.VerifyAll(); }
public void Minify_Minified() { // Arrange var debugger = Mocks.Create<IDebugger>(); debugger.Setup(d => d.IsAttached).Returns(false); var httpContext = Mocks.Create<HttpContextBase>(); httpContext.Setup(c => c.IsDebuggingEnabled).Returns(false); var fullContent = "full"; var minifiedContent = "minified"; var minifier = new Minifier(debugger.Object, httpContext.Object); // Act var result = minifier.Minify(fullContent, minifiedContent); // Assert Assert.That(result, Is.EqualTo(minifiedContent), "The content should be minified."); Mocks.VerifyAll(); }