Community > Ivonna, bugs and questions > Ivonna and VS2005 testing tools

4/30/2008 3:09:26 AM
Total Posts: 0

Ivonna and VS2005 testing tools


Hi,

I was wondering if this works while using the in visual studio 2005 integrated testing tools?

My code:

using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Ivonna.Framework;
using Ivonna.Core;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace IvonnaTestProject
{
/// <summary>
/// Summary description for UnitTest1
/// </summary>
[TestClass, RunOnWebAttribute(@"C:\TEMP\MyTemp\IvonnaTestingWebSite\PrecompiledWeb\IvonnaTestingWebSite", "/")]
public class UnitTest1 : WebFixture
{
public UnitTest1()
{}

[TestMethod]
public void IvonnaMethod()
{
TestSession session = InitSession();
Page testPage = session.GetPage("Default.aspx");

TextBox tb = (TextBox)testPage.FindControl("NameTextBox");
tb.Text = "John";

testPage = session.ProcessPostback("HelloButton");

Label l = (Label)testPage.FindControl("HelloLabel");
Assert.AreEqual<String>("Hello John", l.Text, "Clicking the button did not produce the expected value.");
EndSession();
}
}
}

My error:

Method IvonnaTestProject.UnitTest1.IvonnaMethod does not exist.

Is there any extra setup necessary? Or is it just not possible?




4/30/2008 10:44:05 AM
Total Posts: 57

Re: Ivonna and VS2005 testing tools


Hi,

Ivonna should work with any testing framework.

Could you verify that the test assembly that is located in your compiled web's bin folder contains this method?

Note that a new version will appear on the site by the end of the day.

Artem




5/1/2008 2:14:18 PM
Total Posts: 57

Re: Ivonna and VS2005 testing tools


Hello again,

I must confess I've never tried MsTest until today, so I'v missed an
important point.

First, you should ensure that the Test Storage parameter for your test
should point to the correct location (i.e., the bin folder of your
Web). I guess it's corrected once you have compiled your test, but
until that, Visual Studio tries to find your test assembly (and
Ivonna) in /bin/Debug.

Second, you should disable deployment in your .testrunconfig file.
Again, unless you do that, VS looks for Ivonna in a wrong location.

Hope this helps. I'll add this to the documentation asap.

Artem




5/2/2008 10:26:33 AM
Total Posts: 0

Re: Ivonna and VS2005 testing tools


I am getting the following error when running the example in VS2008.

Test method WebSiteTestProject.UnitTest1.TestMethod1 threw exception: System.IO.FileNotFoundException: Could not load file or assembly 'Ivonna, Version=1.0.0.32325, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Please advise.

 

 

 




5/2/2008 1:56:57 PM
Total Posts: 57

Re: Ivonna and VS2005 testing tools


Are you using MsTest? If yes, please follow the instructions of the previous post: open the testrunconfig file and uncheck deployment. In any case, please confirm that the test project output is set to the bin folder of your web.

It would be really helpful if you could provide the assembly binding log.

Artem




5/5/2008 4:38:09 AM
Total Posts: 0

Re: Ivonna and VS2005 testing tools


I switched from the older version of ivonna to the new one and now it works.
Looks like there was just a problem with the older version...

What i did:

I removed the WebFixture.
I changed TestSession session = InitSession(); to TestSession session = new TestSession();
I removed EndSession();

These steps are just a result of using the newer version of ivonna.
I did not change any settings in the testrunconfig and my buildpath of my test project was allready correct...




5/5/2008 6:42:49 AM
Total Posts: 57

Re: Ivonna and VS2005 testing tools


Great that it worked for you!

Note that now you also don't have to use any arguments in the RunOnWeb attribute, provided you use the default setup and you don't use the virtual path in your code.

Please let us know how it works.

Artem