--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <PropertyGroup>\r
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
+ <ProjectGuid>{C28C111B-2CB5-4000-8F3A-BF4000789B13}</ProjectGuid>\r
+ <OutputType>Library</OutputType>\r
+ <AppDesignerFolder>Properties</AppDesignerFolder>\r
+ <RootNamespace>KancolleSniffer.Test</RootNamespace>\r
+ <AssemblyName>KancolleSniffer.Test</AssemblyName>\r
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
+ <FileAlignment>512</FileAlignment>\r
+ <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>\r
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>\r
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>\r
+ <IsCodedUITest>False</IsCodedUITest>\r
+ <TestProjectType>UnitTest</TestProjectType>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+ <DebugSymbols>true</DebugSymbols>\r
+ <DebugType>full</DebugType>\r
+ <Optimize>false</Optimize>\r
+ <OutputPath>bin\Debug\</OutputPath>\r
+ <DefineConstants>DEBUG;TRACE</DefineConstants>\r
+ <ErrorReport>prompt</ErrorReport>\r
+ <WarningLevel>4</WarningLevel>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+ <DebugType>pdbonly</DebugType>\r
+ <Optimize>true</Optimize>\r
+ <OutputPath>bin\Release\</OutputPath>\r
+ <DefineConstants>TRACE</DefineConstants>\r
+ <ErrorReport>prompt</ErrorReport>\r
+ <WarningLevel>4</WarningLevel>\r
+ </PropertyGroup>\r
+ <ItemGroup>\r
+ <Reference Include="DynamicJson">\r
+ <HintPath>..\Libraries\DynamicJson\DynamicJson.dll</HintPath>\r
+ </Reference>\r
+ <Reference Include="ExpressionToCodeLib">\r
+ <HintPath>..\packages\ExpressionToCodeLib.1.4.6.0\lib\net40-Client\ExpressionToCodeLib.dll</HintPath>\r
+ </Reference>\r
+ <Reference Include="Microsoft.CSharp" />\r
+ <Reference Include="System" />\r
+ </ItemGroup>\r
+ <Choose>\r
+ <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">\r
+ <ItemGroup>\r
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
+ </ItemGroup>\r
+ </When>\r
+ <Otherwise>\r
+ <ItemGroup>\r
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />\r
+ </ItemGroup>\r
+ </Otherwise>\r
+ </Choose>\r
+ <ItemGroup>\r
+ <Compile Include="SnifferTest.cs" />\r
+ <Compile Include="Properties\AssemblyInfo.cs" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ProjectReference Include="..\KancolleSniffer\KancolleSniffer.csproj">\r
+ <Project>{c2dd27ce-5ab7-408b-b60c-f3be22b01e85}</Project>\r
+ <Name>KancolleSniffer</Name>\r
+ </ProjectReference>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="packages.config" />\r
+ </ItemGroup>\r
+ <Choose>\r
+ <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">\r
+ <ItemGroup>\r
+ <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">\r
+ <Private>False</Private>\r
+ </Reference>\r
+ <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">\r
+ <Private>False</Private>\r
+ </Reference>\r
+ <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">\r
+ <Private>False</Private>\r
+ </Reference>\r
+ <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">\r
+ <Private>False</Private>\r
+ </Reference>\r
+ </ItemGroup>\r
+ </When>\r
+ </Choose>\r
+ <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />\r
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
+ Other similar extension points exist, see Microsoft.Common.targets.\r
+ <Target Name="BeforeBuild">\r
+ </Target>\r
+ <Target Name="AfterBuild">\r
+ </Target>\r
+ -->\r
+</Project>
\ No newline at end of file
--- /dev/null
+using System.Reflection;\r
+using System.Runtime.InteropServices;\r
+\r
+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。\r
+// アセンブリに関連付けられている情報を変更するには、\r
+// これらの属性値を変更してください。\r
+[assembly: AssemblyTitle("UnitTest")]\r
+[assembly: AssemblyDescription("")]\r
+[assembly: AssemblyConfiguration("")]\r
+[assembly: AssemblyCompany("Microsoft")]\r
+[assembly: AssemblyProduct("UnitTest")]\r
+[assembly: AssemblyCopyright("Copyright © Microsoft 2014")]\r
+[assembly: AssemblyTrademark("")]\r
+[assembly: AssemblyCulture("")]\r
+\r
+// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから \r
+// 参照できなくなります。このアセンブリ内で COM から型にアクセスする必要がある場合は、 \r
+// その型の ComVisible 属性を true に設定してください。\r
+[assembly: ComVisible(false)]\r
+\r
+// このプロジェクトが COM に公開される場合、次の GUID がタイプ ライブラリの ID になります。\r
+[assembly: Guid("ecafd7c1-1e9b-42f0-aebb-96c57f235c5b")]\r
+\r
+// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:\r
+//\r
+// Major Version\r
+// Minor Version \r
+// Build Number\r
+// Revision\r
+//\r
+// すべての値を指定するか、以下のように '*' を使用してビルド番号とリビジョン番号を \r
+// 既定値にすることができます:\r
+// [assembly: AssemblyVersion("1.0.*")]\r
+[assembly: AssemblyVersion("1.0.0.0")]\r
+[assembly: AssemblyFileVersion("1.0.0.0")]\r
--- /dev/null
+using System;\r
+using System.Collections.Generic;\r
+using System.IO;\r
+using System.IO.Compression;\r
+using System.Linq;\r
+using Codeplex.Data;\r
+using Microsoft.VisualStudio.TestTools.UnitTesting;\r
+\r
+namespace KancolleSniffer.Test\r
+{\r
+ [TestClass]\r
+ public class SnifferTest\r
+ {\r
+ private StreamReader OpenLogFile(string path)\r
+ {\r
+ return new StreamReader(new GZipStream(File.Open(path, FileMode.Open), CompressionMode.Decompress));\r
+ }\r
+\r
+ private void SniffLogFile(Sniffer sniffer, string name)\r
+ {\r
+ var dir = Path.GetDirectoryName(Path.GetDirectoryName(Environment.CurrentDirectory));\r
+ if (dir == null)\r
+ return;\r
+ var ln = 0;\r
+ var stream = OpenLogFile(Path.Combine(dir, Path.Combine("logs", name + ".log.gz")));\r
+ while (!stream.EndOfStream)\r
+ {\r
+ var triple = new List<string>();\r
+ foreach (var s in new[] {"url: ", "request: ", "response: "})\r
+ {\r
+ var line = stream.ReadLine();\r
+ ln++;\r
+ if (line == null)\r
+ throw new Exception(string.Format("ログのurl, request, responseがそろっていません: {0:d}行目", ln));\r
+ if (!line.StartsWith(s))\r
+ throw new Exception(string.Format("ログに不正な行が含まれています: {0:d}行目", ln));\r
+ triple.Add(line.Substring(s.Count()));\r
+ }\r
+ var json = DynamicJson.Parse(triple[2]);\r
+ sniffer.Sniff(triple[0], triple[1], json);\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file
\r
Microsoft Visual Studio Solution File, Format Version 12.00\r
# Visual Studio 2013\r
-VisualStudioVersion = 12.0.21005.1\r
+VisualStudioVersion = 12.0.31101.0\r
MinimumVisualStudioVersion = 10.0.40219.1\r
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KancolleSniffer", "KancolleSniffer\KancolleSniffer.csproj", "{C2DD27CE-5AB7-408B-B60C-F3BE22B01E85}"\r
EndProject\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KancolleSniffer.Test", "KancolleSniffer.Test\KancolleSniffer.Test.csproj", "{C28C111B-2CB5-4000-8F3A-BF4000789B13}"\r
+EndProject\r
Global\r
GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
Debug|Any CPU = Debug|Any CPU\r
{C2DD27CE-5AB7-408B-B60C-F3BE22B01E85}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
{C2DD27CE-5AB7-408B-B60C-F3BE22B01E85}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
{C2DD27CE-5AB7-408B-B60C-F3BE22B01E85}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {C28C111B-2CB5-4000-8F3A-BF4000789B13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {C28C111B-2CB5-4000-8F3A-BF4000789B13}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {C28C111B-2CB5-4000-8F3A-BF4000789B13}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {C28C111B-2CB5-4000-8F3A-BF4000789B13}.Release|Any CPU.Build.0 = Release|Any CPU\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r