The root cause could be the visibility of the test class.
Reason why I raise my point of view is that I could run the two test cases
below after make the test class public.
Am Mittwoch, 5. Dezember 2012 08:31:53 UTC+1 schrieb littlechap22:
>
>
> TestClass.cs
> ====
> using Microsoft.VisualStudio.TestTools.UnitTesting;
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
> using Rhino.Mocks;
> using SampleRhinoMocksTestingApplication;
>
> namespace RhinoTests
> {
> [TestClass]
> *public* class Program
> {
> [TestMethod]
> public void DaytimeTest()
> {
> MockRepository mocks = new MockRepository();
> IDateTime timeController = mocks.StrictMock<IDateTime>();
>
> using (mocks.Record())
> {
> Expect.Call(timeController.GetHour()).Return(15);
> }
>
> using (mocks.Playback())
> {
> string expectedImagePath = "sun.jpg";
> ImageManagement image = new ImageManagement();
> string path = image.GetImageForTimeOfDay(timeController);
> Assert.AreEqual(expectedImagePath, path);
> }
> }
>
> [TestMethod]
> public void NighttimeTest()
> {
> MockRepository mocks = new MockRepository();
> IDateTime timeController = mocks.StrictMock<IDateTime>();
> using (mocks.Record())
> {
> Expect.Call(timeController.GetHour()).Return(1);
> }
>
> using (mocks.Playback())
> {
> string expectedImagePath = "moon.jpg";
> ImageManagement image = new ImageManagement();
> string path = image.GetImageForTimeOfDay(timeController);
> Assert.AreEqual(expectedImagePath, path);
> }
> }
> }
> }
> ====
>
> I have been able to build the project successfully.
>
> But when I go to menu bar in visual studio 2012 to; Test -> Windows ->
> Test Explorer; the test explorer open but I am unable to find any of the
> test methods in the list.
>
> I have search the internet for configuring up rhino mocks in visual studio
> 2012 but unable to find a good guide. Please let me know to how to set up
> the framework or anything I am missing.
>
> Thanks.
>
> -littlechap22
>
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rhinomocks.
For more options, visit https://groups.google.com/groups/opt_out.