public ScriptTagTester() { new FileSystem().WriteStringToFile("foo.js", "some stuff"); theFile = new FubuFile("foo.js", ContentFolder.Application); theFile.RelativePath = "foo.js"; }
public void SetUp() { new FileSystem().WriteStringToFile("foo.txt", "some text"); theFile = new FubuFile("foo.txt"); theResponse = MockRepository.GenerateMock <IHttpResponse>(); }
public void SetUp() { new FileSystem().WriteStringToFile("foo.txt", "some text"); theFile = new FubuFile("foo.txt", "application"); theWriter = MockRepository.GenerateMock <IHttpWriter>(); }
public void SetUp() { new FileSystem().WriteStringToFile("foo.txt", "some text"); theFile = new FubuFile("foo.txt"); theResponse = MockRepository.GenerateMock <IHttpResponse>(); WriteFileHeadContinuation.WriteHeaders(theResponse, theFile); }
public void read_lines() { var file = new FubuFile(Path.Combine("Runtime", "Files", "Data", "a.txt"), ContentFolder.Application); var action = MockRepository.GenerateMock <Action <string> >(); file.ReadLines(action); action.AssertWasCalled(x => x.Invoke("some text from a.txt")); }
private AuthorizationRight forFile(string filename) { var file = new FubuFile(filename); var owinSettings = new AssetSettings(); owinSettings.StaticFileRules.Add(new AssetSettings()); return(owinSettings.DetermineStaticFileRights(file)); }
public void SetUp() { theResponse = MockRepository.GenerateMock <IHttpResponse>(); new FileSystem().WriteStringToFile("foo.txt", "some text"); theFile = new FubuFile("foo.txt", "application"); new WriteFileContinuation(theResponse, theFile, new AssetSettings()) .Write(theResponse); }
public void is_not_under_exploded_bottle_folder_positive() { new[] { "some/content", "custom/packages", "files" }.Each(folder => { var directory = "runtime/{0}".ToFormat(folder); var fubuFile = new FubuFile("{0}/b.txt".ToFormat(directory), "app"); fubuFile.RelativePath = fubuFile.Path.PathRelativeTo(directory); FubuApplicationFiles.IsNotUnderExplodedBottleFolder(fubuFile).ShouldBeTrue(); }); }
public void is_not_under_exploded_bottle_folder_negative() { new[] { FubuMvcPackageFacility.FubuContentFolder, FubuMvcPackageFacility.FubuPackagesFolder }.Each(folder => { var directory = "runtime/{0}/p1".ToFormat(folder); var fubuFile = new FubuFile("{0}/a.txt".ToFormat(directory), "p1"); fubuFile.RelativePath = fubuFile.Path.PathRelativeTo(directory); FubuApplicationFiles.IsNotUnderExplodedBottleFolder(fubuFile).ShouldBeFalse(); }); }
public void etag_is_predictable() { new FileSystem().WriteStringToFile("ghostbusters.txt", "Who you gonna call?"); var etag1 = new FubuFile("ghostbusters.txt").Etag(); var etag2 = new FubuFile("ghostbusters.txt").Etag(); var etag3 = new FubuFile("ghostbusters.txt").Etag(); etag1.ShouldBe(etag2); etag1.ShouldBe(etag3); }
public void etag_changes_on_file_changes() { new FileSystem().WriteStringToFile("ghostbusters.txt", "Who you gonna call?"); var etag1 = new FubuFile("ghostbusters.txt").Etag(); new FileSystem().WriteStringToFile("ghostbusters.txt", "He slimed me!"); var etag2 = new FubuFile("ghostbusters.txt").Etag(); etag1.ShouldNotBe(etag2); }
public void read_contents_by_stream() { var wasCalled = false; var file = new FubuFile(Path.Combine("Runtime", "Files", "Data", "a.txt"), ContentFolder.Application); file.ReadContents(stream => { wasCalled = true; stream.ReadAllText().ShouldEqual("some text from a.txt"); }); wasCalled.ShouldBeTrue(); }
public void last_modified() { var now = DateTime.UtcNow; new FileSystem().WriteStringToFile("ghostbusters.txt", "Who you gonna call?"); var lastModified = new FubuFile("ghostbusters.txt") .LastModified(); (lastModified.ToFileTimeUtc() - now.ToFileTimeUtc()) .ShouldBeLessThan(1); }
public void read_contents() { var file = new FubuFile(Path.Combine("Runtime", "Files", "Data", "a.txt"), ContentFolder.Application); file.ReadContents().Trim().ShouldEqual("some text from a.txt"); }
public void read_contents() { var file = new FubuFile(Path.Combine("Runtime", "Files", "Data", "a.txt")); file.ReadContents().Trim().ShouldBe("some text from a.txt"); }
private AuthorizationRight forFile(string filename) { var file = new FubuFile(filename, null); return(new OwinSettings().DetermineStaticFileRights(file)); }