public void ShouldNotLoadAssetThatDoesntExist() { var ctlr = new AssetsController(); var ctx = new TestHttpContext(); var rezult = ctlr.At(ctx, new List <PositionedResult>(), @"c:\Temp\", Guid.NewGuid() + "\\index.html"); ctx.Response.StatusCode.Should().Be(404); }
public void ShouldNotLoadAssetOutOfSandBox() { var ctlr = new AssetsController(); var ctx = new TestHttpContext(); var rezult = ctlr.At(ctx, new List <PositionedResult>(), @"c:\Something\", @"path\..\..\"); ctx.Response.StatusCode.Should().Be(404); }
public void ShouldLoadAssetThatExists() { var ctlr = new AssetsController(); var ctx = new TestHttpContext(); var path = Path.GetTempFileName(); File.WriteAllText(path, "Scott Youngblut"); var rezult = ctlr.At(ctx, new List <PositionedResult>(), Path.GetDirectoryName(path), Path.GetFileName(path)); ctx.Response.StatusCode.Should().Be(200); rezult.Content.BodyAsString.Should().Be("Scott Youngblut"); }