Skip to content

Commit

Permalink
Resharped.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmind committed Jun 2, 2011
1 parent 213c2cd commit 7ca6880
Show file tree
Hide file tree
Showing 123 changed files with 4,274 additions and 4,488 deletions.
3 changes: 3 additions & 0 deletions AssemblyInfoCommon.cs
@@ -0,0 +1,3 @@
using System.Reflection;

[assembly: AssemblyCopyright("Copyright © Andrey Shchekin 2010–2011")]
173 changes: 88 additions & 85 deletions Core.Tests/Core.Tests.csproj
@@ -1,86 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{93813FFE-7AD9-40A3-96DF-A00A8C5137F8}</ProjectGuid>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AshMind.Gallery.Core.Tests</RootNamespace>
<AssemblyName>AshMind.Gallery.Core.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AshMind.Extensions, Version=1.0.1.0, Culture=neutral, PublicKeyToken=32a35e6126a2a893, processorArchitecture=MSIL" />
<Reference Include="Gallio" />
<Reference Include="MbUnit" />
<Reference Include="Moq">
<HintPath>..\.Libraries\Moq.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Gallio35" />
<Reference Include="MbUnit35" />
<Reference Include="System.Core">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="IO\MemoryFile.cs" />
<Compile Include="IO\MemoryFileSystem.cs" />
<Compile Include="IO\MemoryLocation.cs" />
<Compile Include="IO\Resource.cs" />
<Compile Include="Of.AlbumSupport\AlbumIDProviderTest.cs" />
<Compile Include="Of.Integration\Picasa\PicasaIniParserTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj">
<Project>{BF5A70D6-912D-472E-A1F7-607B88F062BB}</Project>
<Name>Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Of.Integration\Picasa\Resources\picasa.simple.ini" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Of.Integration\Picasa\Resources\picasa.complex.ini" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{93813FFE-7AD9-40A3-96DF-A00A8C5137F8}</ProjectGuid>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AshMind.Gallery.Core.Tests</RootNamespace>
<AssemblyName>AshMind.Gallery.Core.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AshMind.Extensions, Version=1.0.1.0, Culture=neutral, PublicKeyToken=32a35e6126a2a893, processorArchitecture=MSIL" />
<Reference Include="Gallio" />
<Reference Include="MbUnit" />
<Reference Include="Moq">
<HintPath>..\.Libraries\Moq.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Gallio35" />
<Reference Include="MbUnit35" />
<Reference Include="System.Core">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\AssemblyInfoCommon.cs">
<Link>Properties\AssemblyInfoCommon.cs</Link>
</Compile>
<Compile Include="IO\MemoryFile.cs" />
<Compile Include="IO\MemoryFileSystem.cs" />
<Compile Include="IO\MemoryLocation.cs" />
<Compile Include="IO\Resource.cs" />
<Compile Include="Of.AlbumSupport\AlbumIDProviderTest.cs" />
<Compile Include="Of.Integration\Picasa\PicasaIniParserTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj">
<Project>{BF5A70D6-912D-472E-A1F7-607B88F062BB}</Project>
<Name>Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Of.Integration\Picasa\Resources\picasa.simple.ini" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Of.Integration\Picasa\Resources\picasa.complex.ini" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
170 changes: 84 additions & 86 deletions Core.Tests/IO/MemoryFile.cs
@@ -1,86 +1,84 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;

using AshMind.Gallery.Core.IO;

namespace AshMind.Gallery.Core.Tests.IO {
public class MemoryFile : IFile {
private MemoryStream stream = new MemoryStream();

public MemoryFile() {
this.Exists = true;
}

public MemoryFile(MemoryLocation location, string name, bool exists) {
this.Location = location;
this.Name = name;
this.Exists = exists;
}

public DateTimeOffset GetLastWriteTime() {
throw new NotImplementedException();
}

private void ReopenStream() {
var bytes = this.stream.ToArray();
this.stream = new MemoryStream();
this.stream.Write(bytes, 0, bytes.Length);
}

public Stream Read(FileLockMode lockMode) {
if (!this.stream.CanRead) // disposed
this.ReopenStream();

this.stream.Seek(0, SeekOrigin.Begin);
return this.stream;
}

public Stream Open(FileLockMode lockMode, FileOpenMode openMode) {
if (!this.stream.CanWrite) // disposed
this.ReopenStream();

if (openMode == FileOpenMode.Append) {
this.stream.Seek(0, SeekOrigin.End);
return this.stream;
}

if (openMode == FileOpenMode.ReadOrWrite) {
this.stream.Seek(0, SeekOrigin.Begin);
return this.stream;
}

if (openMode == FileOpenMode.Recreate) {
this.stream = new MemoryStream();
return this.stream;
}

throw new ArgumentOutOfRangeException("openMode");
}

public string Name { get; set; }

public string Path {
get { throw new NotImplementedException(); }
}

public bool Exists { get; set; }

public bool IsHidden() {
throw new NotImplementedException();
}

public void SetHidden(bool value) {
throw new NotImplementedException();
}

public byte[] GetBytes() {
return this.stream.ToArray();
}

public ILocation Location { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

using AshMind.Gallery.Core.IO;

namespace AshMind.Gallery.Core.Tests.IO {
public class MemoryFile : IFile {
private MemoryStream stream = new MemoryStream();

public MemoryFile() {
this.Exists = true;
}

public MemoryFile(MemoryLocation location, string name, bool exists) {
this.Location = location;
this.Name = name;
this.Exists = exists;
}

public DateTimeOffset GetLastWriteTime() {
throw new NotImplementedException();
}

private void ReopenStream() {
var bytes = this.stream.ToArray();
this.stream = new MemoryStream();
this.stream.Write(bytes, 0, bytes.Length);
}

public Stream Read(FileLockMode lockMode) {
if (!this.stream.CanRead) // disposed
this.ReopenStream();

this.stream.Seek(0, SeekOrigin.Begin);
return this.stream;
}

public Stream Open(FileLockMode lockMode, FileOpenMode openMode) {
if (!this.stream.CanWrite) // disposed
this.ReopenStream();

if (openMode == FileOpenMode.Append) {
this.stream.Seek(0, SeekOrigin.End);
return this.stream;
}

if (openMode == FileOpenMode.ReadOrWrite) {
this.stream.Seek(0, SeekOrigin.Begin);
return this.stream;
}

if (openMode == FileOpenMode.Recreate) {
this.stream = new MemoryStream();
return this.stream;
}

throw new ArgumentOutOfRangeException("openMode");
}

public string Name { get; set; }

public string Path {
get { throw new NotImplementedException(); }
}

public bool Exists { get; set; }

public bool IsHidden() {
throw new NotImplementedException();
}

public void SetHidden(bool value) {
throw new NotImplementedException();
}

public byte[] GetBytes() {
return this.stream.ToArray();
}

public ILocation Location { get; set; }
}
}

0 comments on commit 7ca6880

Please sign in to comment.