Davy
Davy

Reputation: 1796

Nunit fails to start my application

Visual Studio 2010 Express C#, NUnit 2.5.8, White 0.2.0

I am trying to write some tests with the NUnit + White framework. I can get the White demo (ListBoxExample) up and running without problems.

But when I write a simple test for my own application (.Net 4.0), I have 2 problems:

  1. Application.Launch(""): This statement does not complain, but does NOT launch my application at all. The path is correct because if I put an incorrect path, I get an error. With the right path there are no errors, but no application is starting.

  2. application.GetWindow(...) This statement causes an error:

DocBackupTestSuite.Tests.StartupTest: System.IO.FileLoadException : Could not load file or assembly 'Bricks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

But the Bricks.dll file IS referenced in my project...

Thank you for your help

Davy

Upvotes: 2

Views: 569

Answers (3)

Wazzz
Wazzz

Reputation: 195

If you face this problem below when you use the UI automation library(White-project)

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Bricks, 
Version=1.0.0.0, Culture=neutral, PublicKeyToken=83a26c96fb92c77f' or one of its dependencies.   
The system cannot find the file specified.
File name: 'Bricks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=83a26c96fb92c77f'

please take the following solution:

Add Reference of the dll list as follow:

•Bricks

•Bricks.RuntimeFramework

•Castle.Core

•Castle.DynamicProxy2

•log4net

•nunit.framework

•White.NUnit

•Xstream.Core

Hope your code can be work successfully now.

Download theses stuff here

http://white-project.googlecode.com/svn/tags/0.20/lib/

Reference fromhttp://sunshinetoast.com/Default.aspx

Upvotes: 0

Davy
Davy

Reputation: 1796

2nd problem also solved:

A reference to Bricks.RuntimeFramework was missing. After adding this, my test runs fine ;)

Upvotes: 0

Davy
Davy

Reputation: 1796

First problem is solved.

The code did not wait long enough to leave time for the application to start. Added a Thread.Sleep(10000) after the Application.Launch() statement, and now it starts up.

2nd problem is still pending... Anyone?

Upvotes: 0

Related Questions