public void CreatesProperWebPage() { DirectoryHandler target = new DirectoryHandler(); Request req = new Request(); req.HttpPath = "/misc/"; Assert.AreEqual("<html><head><title>Directory</title></head><body></body></html>", target.Handle(req)); // TODO: Finish test. }
public void TextHandleTest() { TextHandler target = new TextHandler(); Request req = new Request(); req.HttpPath = "/index.html"; string testFilePath = AppDomain.CurrentDomain.BaseDirectory.TrimEnd(new[] {'\\'}) + "\\" + Configurator.Instance.RelativeWwwPath.TrimEnd(new[] {'\\'}) + "\\index.html"; WriteTestFile(testFilePath); string text = System.IO.File.ReadAllText(testFilePath); byte[] bytes = Encoding.ASCII.GetBytes(text); //VK: commented, because exception was thrown? //Assert.IsTrue(target.Handle(req).Data.SequenceEqual(bytes)); }