Skip to content
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.

Commit

Permalink
Added NUnit tests for automatic tests on the application library
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutomi committed May 19, 2012
1 parent 72ed07c commit 2f951a2
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
/src/_ReSharper.dshell.vs2010
/src/packages
/src/sampleapp/obj
/src/sampleapp/bin
/src/sampleapp/bin
/src/dshell-nunit.vs2010/obj
/src/dshell-nunit.vs2010/bin
17 changes: 17 additions & 0 deletions src/dshell-nunit.vs2010/Deveel.Console/StringWriteEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace Deveel.Console {
public delegate void StringWriteEventHandler(object sender, StringWriteEventArgs args);

public sealed class StringWriteEventArgs : EventArgs {
public readonly string s;

public StringWriteEventArgs(string s) {
this.s = s;
}

public string Value {
get { return s; }
}
}
}
57 changes: 57 additions & 0 deletions src/dshell-nunit.vs2010/Deveel.Console/TestOutputDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Deveel.Console {
class TestOutputDevice : OutputDevice {
private readonly TextWriter outputSink;
private readonly List<string> stringList;

public TestOutputDevice() {
outputSink = new OutputSink(this);
stringList = new List<string>();
}

public event StringWriteEventHandler StringWritten;

public override Encoding Encoding {
get { return Encoding.ASCII; }
}

protected override TextWriter Output {
get { return outputSink; }
}

public IEnumerable<string> Strings {
get { return stringList.AsReadOnly(); }
}

protected void OnStringWritten(string s) {
if (StringWritten != null)
StringWritten(this, new StringWriteEventArgs(s));

stringList.Add(s);
}

#region OutputSink

class OutputSink : TextWriter {
private readonly TestOutputDevice outputDevice;

public OutputSink(TestOutputDevice outputDevice) {
this.outputDevice = outputDevice;
}

public override Encoding Encoding {
get { return outputDevice.Encoding; }
}

public override void Write(char[] buffer, int index, int count) {
outputDevice.OnStringWritten(new string(buffer, index, count));
}
}

#endregion
}
}
36 changes: 36 additions & 0 deletions src/dshell-nunit.vs2010/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Per modificare le informazioni associate a un assembly
// occorre quindi modificare i valori di questi attributi.
[assembly: AssemblyTitle("dshell-nunit")]
[assembly: AssemblyDescription("Deveel Shell Library NUnit Tests")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Deveel")]
[assembly: AssemblyProduct("dshell-nunit")]
[assembly: AssemblyCopyright("Copyright © Deveel 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
// COM, impostare su true l'attributo ComVisible per tale tipo.
[assembly: ComVisible(false)]

// Se il progetto viene esposto a COM, il GUID che segue verrà utilizzato per creare l'ID della libreria dei tipi
[assembly: Guid("3bba22e3-4f21-4bbc-8663-a292ecb9ae2d")]

// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
//
// Numero di versione principale
// Numero di versione secondario
// Numero build
// Revisione
//
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// utilizzando l'asterisco (*) come descritto di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.6.7.*")]
[assembly: AssemblyFileVersion("0.6.7.0")]
55 changes: 55 additions & 0 deletions src/dshell-nunit.vs2010/dshell-nunit.vs2010.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{443F911C-939E-4098-AAB0-8E452FA28E80}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Deveel.Console</RootNamespace>
<AssemblyName>dshell-nunit</AssemblyName>
<TargetFrameworkVersion>v2.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="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Deveel.Console\StringWriteEventArgs.cs" />
<Compile Include="Deveel.Console\TestOutputDevice.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\dshell\dshell.vs2010.csproj">
<Project>{5E849796-A39E-4AF8-A516-D2837C3CCE6F}</Project>
<Name>dshell.vs2010</Name>
</ProjectReference>
</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>
12 changes: 12 additions & 0 deletions src/dshell.vs2010.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dshell.vs2010", "dshell\dsh
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sampleapp", "sampleapp\sampleapp.csproj", "{EBC6095C-6575-4716-A937-4280B37ABCE6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dshell-nunit.vs2010", "dshell-nunit.vs2010\dshell-nunit.vs2010.csproj", "{443F911C-939E-4098-AAB0-8E452FA28E80}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -35,6 +37,16 @@ Global
{EBC6095C-6575-4716-A937-4280B37ABCE6}.Release|Mixed Platforms.Build.0 = Release|x86
{EBC6095C-6575-4716-A937-4280B37ABCE6}.Release|x86.ActiveCfg = Release|x86
{EBC6095C-6575-4716-A937-4280B37ABCE6}.Release|x86.Build.0 = Release|x86
{443F911C-939E-4098-AAB0-8E452FA28E80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{443F911C-939E-4098-AAB0-8E452FA28E80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{443F911C-939E-4098-AAB0-8E452FA28E80}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{443F911C-939E-4098-AAB0-8E452FA28E80}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{443F911C-939E-4098-AAB0-8E452FA28E80}.Debug|x86.ActiveCfg = Debug|Any CPU
{443F911C-939E-4098-AAB0-8E452FA28E80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{443F911C-939E-4098-AAB0-8E452FA28E80}.Release|Any CPU.Build.0 = Release|Any CPU
{443F911C-939E-4098-AAB0-8E452FA28E80}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{443F911C-939E-4098-AAB0-8E452FA28E80}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{443F911C-939E-4098-AAB0-8E452FA28E80}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
23 changes: 23 additions & 0 deletions src/dshell/dshell.0.6.7-beta.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<version>0.6.7-beta</version>
<authors>Antonello Provenzano</authors>
<owners>Deveel</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
<projectUrl>http://github.com/deveel/dshell</projectUrl>
<dependencies>
<dependency id="deveelrl" />
<dependency id="deveel-cli" version="1.0.1" />
</dependencies>
<id>dshell</id>
<title>Deveel Shell Application Library</title>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This library is used to easily develop .NET/Mono shell applications, providing command line parsing, execution context, and other functionalities to design interactive console applications.</description>
<copyright>Copyright 2010-2012 Deveel</copyright>
<tags>command-line console shell .NET Mono deveel application command</tags>
</metadata>
<files>
<file src="bin\Release\dshell.dll" target="lib\net20\dshell.dll" />
</files>
</package>

0 comments on commit 2f951a2

Please sign in to comment.