Revision cedf7fb5

b/trunk/Pithos.TestServer.Test/Pithos.TestServer.Test.csproj
1
<?xml version="1.0" encoding="utf-8"?>
2
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
  <PropertyGroup>
5
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
    <ProjectGuid>{6F4A676E-6255-4947-ACCF-8B731E17DF8F}</ProjectGuid>
8
    <OutputType>Library</OutputType>
9
    <AppDesignerFolder>Properties</AppDesignerFolder>
10
    <RootNamespace>Pithos.TestServer.Test</RootNamespace>
11
    <AssemblyName>Pithos.TestServer.Test</AssemblyName>
12
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13
    <FileAlignment>512</FileAlignment>
14
    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
15
    <RestorePackages>true</RestorePackages>
16
  </PropertyGroup>
17
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18
    <DebugSymbols>true</DebugSymbols>
19
    <DebugType>full</DebugType>
20
    <Optimize>false</Optimize>
21
    <OutputPath>bin\Debug\</OutputPath>
22
    <DefineConstants>DEBUG;TRACE</DefineConstants>
23
    <ErrorReport>prompt</ErrorReport>
24
    <WarningLevel>4</WarningLevel>
25
  </PropertyGroup>
26
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27
    <DebugType>pdbonly</DebugType>
28
    <Optimize>true</Optimize>
29
    <OutputPath>bin\Release\</OutputPath>
30
    <DefineConstants>TRACE</DefineConstants>
31
    <ErrorReport>prompt</ErrorReport>
32
    <WarningLevel>4</WarningLevel>
33
  </PropertyGroup>
34
  <ItemGroup>
35
    <Reference Include="nunit.framework">
36
      <HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
37
    </Reference>
38
    <Reference Include="nunit.mocks">
39
      <HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
40
    </Reference>
41
    <Reference Include="pnunit.framework">
42
      <HintPath>..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
43
    </Reference>
44
    <Reference Include="System" />
45
    <Reference Include="System.Core" />
46
    <Reference Include="System.Net.Http" />
47
    <Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
48
    <Reference Include="System.Xml.Linq" />
49
    <Reference Include="System.Data.DataSetExtensions" />
50
    <Reference Include="Microsoft.CSharp" />
51
    <Reference Include="System.Data" />
52
    <Reference Include="System.Xml" />
53
  </ItemGroup>
54
  <ItemGroup>
55
    <Compile Include="RootControllerTests.cs" />
56
    <Compile Include="UserControllerTest.cs" />
57
    <Compile Include="Properties\AssemblyInfo.cs" />
58
  </ItemGroup>
59
  <ItemGroup>
60
    <None Include="packages.config" />
61
  </ItemGroup>
62
  <ItemGroup>
63
    <ProjectReference Include="..\Pithos.TestServer\Pithos.TestServer.csproj">
64
      <Project>{fb4ac325-246d-4ae2-ab58-9a7677b2601b}</Project>
65
      <Name>Pithos.TestServer</Name>
66
    </ProjectReference>
67
  </ItemGroup>
68
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
69
  <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
70
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
71
       Other similar extension points exist, see Microsoft.Common.targets.
72
  <Target Name="BeforeBuild">
73
  </Target>
74
  <Target Name="AfterBuild">
75
  </Target>
76
  -->
77
</Project>
b/trunk/Pithos.TestServer.Test/Properties/AssemblyInfo.cs
1
using System.Reflection;
2
using System.Runtime.CompilerServices;
3
using System.Runtime.InteropServices;
4

  
5
// General Information about an assembly is controlled through the following 
6
// set of attributes. Change these attribute values to modify the information
7
// associated with an assembly.
8
[assembly: AssemblyTitle("Pithos.TestServer.Test")]
9
[assembly: AssemblyDescription("")]
10
[assembly: AssemblyConfiguration("")]
11
[assembly: AssemblyCompany("")]
12
[assembly: AssemblyProduct("Pithos.TestServer.Test")]
13
[assembly: AssemblyCopyright("Copyright ©  2013")]
14
[assembly: AssemblyTrademark("")]
15
[assembly: AssemblyCulture("")]
16

  
17
// Setting ComVisible to false makes the types in this assembly not visible 
18
// to COM components.  If you need to access a type in this assembly from 
19
// COM, set the ComVisible attribute to true on that type.
20
[assembly: ComVisible(false)]
21

  
22
// The following GUID is for the ID of the typelib if this project is exposed to COM
23
[assembly: Guid("9bb5bef2-bcc8-4f94-984b-e61f3d909ebe")]
24

  
25
// Version information for an assembly consists of the following four values:
26
//
27
//      Major Version
28
//      Minor Version 
29
//      Build Number
30
//      Revision
31
//
32
// You can specify all the values or you can default the Build and Revision Numbers 
33
// by using the '*' as shown below:
34
// [assembly: AssemblyVersion("1.0.*")]
35
[assembly: AssemblyVersion("1.0.0.0")]
36
[assembly: AssemblyFileVersion("1.0.0.0")]
b/trunk/Pithos.TestServer.Test/RootControllerTests.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Net;
5
using System.Net.Http;
6
using System.Net.Http.Headers;
7
using System.Text;
8
using System.Threading.Tasks;
9
using NUnit.Framework;
10

  
11
namespace Pithos.TestServer.Test
12
{
13
    [TestFixture]
14
    class RootControllerTests
15
    {
16
        [Test]
17
        public void should_authenticate()
18
        {
19
            
20
            var request = new HttpRequestMessage
21
                {
22
                    RequestUri = new Uri("http://server"),
23
                };
24
            request.Headers.Add("X-Auth-User", "a");
25
            request.Headers.Add("X-Auth-Key", "b");
26
            var controller = new RootController
27
            {
28
                Request = request
29
            };
30
            var response=controller.Get();
31
            Assert.That(response.Headers.Contains("X-Storage-Url"), Is.True);
32
            Assert.That(response.Headers.GetValues("X-Auth-Token"), Contains.Item("b"));
33
        }
34
    }
35
}
b/trunk/Pithos.TestServer.Test/UserControllerTest.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using NUnit.Framework;
7

  
8
namespace Pithos.TestServer.Test
9
{
10
    [TestFixture]
11
    public class UserControllerTest
12
    {
13
        [Test]
14
        public void should_resolve_uuid()
15
        {
16
            var controller = new UsersController();
17
            var response=controller.Post(new UserRequest {uuids = new string[] {"a"}});
18
            Assert.That(response.uuid_catalog, Is.Not.Empty);
19
        }
20
    }
21
}
b/trunk/Pithos.TestServer.Test/packages.config
1
<?xml version="1.0" encoding="utf-8"?>
2
<packages>
3
  <package id="NUnit" version="2.5.10.11092" targetFramework="net45" />
4
</packages>
b/trunk/Pithos.TestServer/RootController.cs
18 18
            var user = Request.Headers.GetValues("X-Auth-User").FirstOrDefault();
19 19
            var key = Request.Headers.GetValues("X-Auth-Key").FirstOrDefault();
20 20

  
21
            var resp = new HttpResponseMessage();
22
            resp.StatusCode = HttpStatusCode.NoContent;
21
            var resp = Request.CreateResponse(HttpStatusCode.NoContent);
22

  
23 23
            resp.Headers.Add("X-Auth-Token",key);
24 24
            resp.Headers.Vary.Add("Accept-Language");
25 25
            var uri = new Uri(Request.RequestUri, user);
b/trunk/Pithos.sln
43 43
EndProject
44 44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pithos.TestServer", "Pithos.TestServer\Pithos.TestServer.csproj", "{FB4AC325-246D-4AE2-AB58-9A7677B2601B}"
45 45
EndProject
46
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pithos.TestServer.Test", "Pithos.TestServer.Test\Pithos.TestServer.Test.csproj", "{6F4A676E-6255-4947-ACCF-8B731E17DF8F}"
47
EndProject
46 48
Global
47 49
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
48 50
		CD_ROM|Any CPU = CD_ROM|Any CPU
......
657 659
		{FB4AC325-246D-4AE2-AB58-9A7677B2601B}.Test|Mixed Platforms.Build.0 = Release|Any CPU
658 660
		{FB4AC325-246D-4AE2-AB58-9A7677B2601B}.Test|x64.ActiveCfg = Release|Any CPU
659 661
		{FB4AC325-246D-4AE2-AB58-9A7677B2601B}.Test|x86.ActiveCfg = Release|Any CPU
662
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
663
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
664
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.CD_ROM|Mixed Platforms.ActiveCfg = Release|Any CPU
665
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.CD_ROM|Mixed Platforms.Build.0 = Release|Any CPU
666
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.CD_ROM|x64.ActiveCfg = Release|Any CPU
667
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.CD_ROM|x86.ActiveCfg = Release|Any CPU
668
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug All|Any CPU.ActiveCfg = Debug|Any CPU
669
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug All|Any CPU.Build.0 = Debug|Any CPU
670
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug All|Mixed Platforms.ActiveCfg = Debug|Any CPU
671
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug All|Mixed Platforms.Build.0 = Debug|Any CPU
672
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug All|x64.ActiveCfg = Debug|Any CPU
673
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug All|x86.ActiveCfg = Debug|Any CPU
674
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
675
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
676
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
677
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
678
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug|x64.ActiveCfg = Debug|Any CPU
679
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug|x86.ActiveCfg = Debug|Any CPU
680
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Debug|x86.Build.0 = Debug|Any CPU
681
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
682
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
683
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.DVD-5|Mixed Platforms.ActiveCfg = Debug|Any CPU
684
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.DVD-5|Mixed Platforms.Build.0 = Debug|Any CPU
685
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.DVD-5|x64.ActiveCfg = Debug|Any CPU
686
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.DVD-5|x86.ActiveCfg = Debug|Any CPU
687
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Premium Debug|Any CPU.ActiveCfg = Debug|Any CPU
688
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Premium Debug|Any CPU.Build.0 = Debug|Any CPU
689
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Premium Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
690
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Premium Debug|Mixed Platforms.Build.0 = Debug|Any CPU
691
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Premium Debug|x64.ActiveCfg = Debug|Any CPU
692
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Premium Debug|x86.ActiveCfg = Debug|Any CPU
693
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
694
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Release|Any CPU.Build.0 = Release|Any CPU
695
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
696
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
697
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Release|x64.ActiveCfg = Release|Any CPU
698
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Release|x86.ActiveCfg = Release|Any CPU
699
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
700
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.SingleImage|Any CPU.Build.0 = Release|Any CPU
701
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.SingleImage|Mixed Platforms.ActiveCfg = Release|Any CPU
702
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.SingleImage|Mixed Platforms.Build.0 = Release|Any CPU
703
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.SingleImage|x64.ActiveCfg = Release|Any CPU
704
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.SingleImage|x86.ActiveCfg = Release|Any CPU
705
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Test|Any CPU.ActiveCfg = Release|Any CPU
706
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Test|Any CPU.Build.0 = Release|Any CPU
707
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Test|Mixed Platforms.ActiveCfg = Release|Any CPU
708
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Test|Mixed Platforms.Build.0 = Release|Any CPU
709
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Test|x64.ActiveCfg = Release|Any CPU
710
		{6F4A676E-6255-4947-ACCF-8B731E17DF8F}.Test|x86.ActiveCfg = Release|Any CPU
660 711
	EndGlobalSection
661 712
	GlobalSection(SolutionProperties) = preSolution
662 713
		HideSolutionNode = FALSE
b/trunk/packages/repositories.config
13 13
  <repository path="..\Pithos.OFM\packages.config" />
14 14
  <repository path="..\Pithos.ShellExtensions.Test\packages.config" />
15 15
  <repository path="..\Pithos.ShellExtensions\packages.config" />
16
  <repository path="..\Pithos.TestServer.Test\packages.config" />
16 17
  <repository path="..\Pithos.TestServer\packages.config" />
17 18
</repositories>

Also available in: Unified diff