Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix some tests

  • Loading branch information...
commit 8621f85a075a90f06674597401b0b730b81af064 1 parent 025af8a
Jeremy Skinner JeremySkinner authored
1  GitAspx.5.1.ReSharper
@@ -30,6 +30,7 @@
30 30 </MODIFIERS_ORDER>
31 31 <OTHER_BRACES>END_OF_LINE</OTHER_BRACES>
32 32 <TYPE_DECLARATION_BRACES>END_OF_LINE</TYPE_DECLARATION_BRACES>
  33 + <WRAP_LINES>False</WRAP_LINES>
33 34 </FormatSettings>
34 35 <UsingsSettings>
35 36 <AddImportsToDeepestScope>True</AddImportsToDeepestScope>
7 GitAspx.Tests/InfoRefsControllerTests.cs
@@ -31,15 +31,13 @@ public class InfoRefsControllerTests {
31 31 [SetUp]
32 32 public void Setup() {
33 33 var dir = new DirectoryInfo("../../Repositories");
34   - controller =
35   - new InfoRefsController(
36   - new RepositoryService(new AppSettings {ReceivePack = true, UploadPack = true, RepositoriesDirectory = dir})).
  34 + controller = new InfoRefsController(new RepositoryService(new AppSettings {ReceivePack = true, UploadPack = true, RepositoriesDirectory = dir})).
37 35 FakeContxt();
38 36 }
39 37
40 38 [Test]
41 39 public void Gets_upload_pack_advertisement() {
42   - /*controller.Execute("test", "git-upload-pack");
  40 + controller.Execute("test", "git-upload-pack");
43 41 controller.Response.StatusCode.ShouldEqual(200);
44 42 controller.Response.ContentType.ShouldContain("application/x-git-upload-pack-advertisement");
45 43
@@ -49,7 +47,6 @@ public class InfoRefsControllerTests {
49 47 body.ShouldContain("0000009514bf0836c3371b740ebad55fbda6223bd7940f20 HEAD");
50 48 body.ShouldContain("multi_ack_detailed");
51 49
52   -*/
53 50 }
54 51
55 52 [Test]
2  GitAspx.Tests/MockHttpContext.cs
@@ -75,7 +75,7 @@ public class HttpResponseMock : Mock<HttpResponseBase> {
75 75 Setup(x => x.OutputStream).Returns(outputStream);
76 76 SetupProperty(x => x.ContentType);
77 77 SetupProperty(x => x.StatusCode);
78   - Setup(x => x.Write(It.IsAny<string>())).Callback(new Action<string>(s => { writer.Write(s); }));
  78 + Setup(x => x.Write(It.IsAny<string>())).Callback(new Action<string>(s => { writer.Write(s); writer.Flush(); }));
79 79 }
80 80 }
81 81
3  GitAspx.Tests/TestExtensions.cs
@@ -37,6 +37,9 @@ public static class TestExtensions {
37 37 }
38 38
39 39 public static string GetString(this Stream stream) {
  40 + if(stream.CanSeek) {
  41 + stream.Position = 0;
  42 + }
40 43 var reader = new StreamReader(stream, Encoding.UTF8);
41 44 var read = new char[256];
42 45 int count = reader.Read(read, 0, 256);
2  GitAspx/Controllers/RpcController.cs
@@ -51,7 +51,7 @@ public class RpcController : BaseController {
51 51 }
52 52
53 53 ActionResult ExecuteRpc(string project, Rpc rpc, Action<Repository> action) {
54   - if (!HasAccess(Rpc.UploadPack, checkContentType: true)) {
  54 + if (!HasAccess(rpc, checkContentType: true)) {
55 55 return new ForbiddenResult();
56 56 }
57 57

0 comments on commit 8621f85

Please sign in to comment.
Something went wrong with that request. Please try again.