This repository has been archived by the owner on Jan 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added NUnit tests for automatic tests on the application library
- Loading branch information
Showing
7 changed files
with
203 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/dshell-nunit.vs2010/Deveel.Console/StringWriteEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
57
src/dshell-nunit.vs2010/Deveel.Console/TestOutputDevice.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |