Permalink
Browse files

reimplement basic nunit test setup

  • Loading branch information...
1 parent cc7d4ad commit 095a785908222d8be5b9c45403a7c1d938b16b1c @ataranto ataranto committed Feb 16, 2012
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ "CefSharp"
+ </assembly>
+ <members>
+ <member name="M:CefSharp.BindingHandler.GetChangeTypeCost(System.Object,System.Type)">
+ <summary />
+ <return>Returns conversion cost, or -1 if no conversion available.</return>
+ </member>
+ <member name="M:CefSharp.IBeforeResourceLoad.HandleBeforeResourceLoad(CefSharp.ICefWebBrowser,CefSharp.IRequestResponse)">
+called before all resource loads.
+allows the Request to be manipulated or an alternate response to be provided
+</member>
+ <member name="M:CefSharp.IRequestResponse.RespondWith(System.IO.Stream,System.String)">
+respond with data from Stream
+</member>
+ <member name="M:CefSharp.IRequestResponse.Redirect(System.String)">
+respond with redirection to the provided URL
+</member>
+ <member name="P:CefSharp.IRequestResponse.Request">
+the current request
+</member>
+ <member name="M:CefSharp.IRequestResponse.Cancel">
+cancel the request, return nothing
+</member>
+ <member name="T:CefSharp.RtzCountdownEvent">
+ <summary>Return-To-Zero latch, signals whenever count is zero</summary>
+ </member>
+ <member name="M:CefSharp.ISchemeHandler.ProcessRequest(CefSharp.IRequest,System.String@,System.IO.Stream@)">
+ <summary>
+if request is handled return true and set mimeType and stream accordingly.
+if no data the leave stream null
+</summary>
+ </member>
+ </members>
+</doc>
@@ -0,0 +1,39 @@
+using System;
+using System.Threading;
+using NUnit.Framework;
+
+namespace CefSharp.Test
+{
+ [TestFixture]
+ public class BrowserTest
+ {
+ [Test]
+ public void FooTest()
+ {
+ Assert.Pass();
+ }
+
+ [Test]
+ public void RunScriptText()
+ {
+ Assert.AreEqual("4", Fixture.Browser.RunScript("2+2"));
+ }
+
+ [Test]
+ public void RunScriptConcurrentTest()
+ {
+ for (var x = 0; x < 3; x++)
+ {
+ var value = x.ToString();
+ new Thread(() =>
+ {
+ var result = Fixture.Browser.RunScript(value);
+ Console.WriteLine("{0} => {1}", value, result);
+ Assert.AreEqual(value, result);
+ }).Start();
+ }
+
+ Thread.Sleep(1000);
+ }
+ }
+}
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{7A4D5447-183B-4A11-8E63-9848991B46FF}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>CefSharp.Test</RootNamespace>
+ <AssemblyName>CefSharp.Test</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\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>..\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework, Version=2.6.0.12035, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\nunit\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Windows.Forms" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="BrowserTest.cs" />
+ <Compile Include="Fixture.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\CefSharp\CefSharp.vcproj">
+ <Project>{7B495581-2271-4F41-9476-ACB86E8C864F}</Project>
+ <Name>CefSharp</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>
View
@@ -0,0 +1,53 @@
+using System.Threading;
+using System.Windows.Forms;
+using NUnit.Framework;
+
+namespace CefSharp.Test
+{
+ [SetUpFixture]
+ public class Fixture
+ {
+ public static CefFormsWebBrowser Browser { get; private set; }
+
+ private ManualResetEvent createdEvent = new ManualResetEvent(false);
+
+ [SetUp]
+ public void SetUp()
+ {
+ var settings = new Settings();
+ if (!CEF.Initialize(settings))
+ {
+ Assert.Fail();
+ }
+
+ var thread = new Thread(() =>
+ {
+ var form = new Form();
+ form.Shown += (sender, e) =>
+ {
+ Browser = new CefFormsWebBrowser()
+ {
+ Parent = form,
+ Dock = DockStyle.Fill,
+ };
+
+ createdEvent.Set();
+ };
+
+ Application.Run(form);
+ });
+ thread.SetApartmentState(ApartmentState.STA);
+ thread.Start();
+
+ createdEvent.WaitOne();
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ createdEvent.WaitOne();
+ CEF.Shutdown();
+ Application.Exit();
+ }
+ }
+}
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("CefSharp.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CefSharp.Test")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("65d5df66-a428-464a-8b4b-46e8393146fb")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
View
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Example", "CefShar
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.WpfExample", "CefSharp.WpfExample\CefSharp.WpfExample.csproj", "{4828DAEC-EF99-4553-B674-4374F77C6D66}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Test", "CefSharp.Test\CefSharp.Test.csproj", "{7A4D5447-183B-4A11-8E63-9848991B46FF}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -47,6 +49,16 @@ Global
{4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Win32.ActiveCfg = Release|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {7A4D5447-183B-4A11-8E63-9848991B46FF}.Release|Win32.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1 @@
+./nunit/nunit-console-x86.exe -domain=None Debug/CefSharp.Test.dll

0 comments on commit 095a785

Please sign in to comment.