|
From: <sm...@us...> - 2003-07-30 15:01:32
|
Update of /cvsroot/nmock/nmock/test/NMock/Dynamic
In directory sc8-pr-cvs1:/tmp/cvs-serv27137/test/NMock/Dynamic
Modified Files:
ClassGeneratorTest.cs
Log Message:
Reformatted to make code folding in VisualStudio work better
Added CallMethodWithVariableNumberOfParams
Index: ClassGeneratorTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/Dynamic/ClassGeneratorTest.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ClassGeneratorTest.cs 25 Jul 2003 15:52:41 -0000 1.9
--- ClassGeneratorTest.cs 30 Jul 2003 15:01:28 -0000 1.10
***************
*** 73,86 ****
}
! [TestFixture]
! public class ClassGeneratorTest
{
-
private ClassGenerator cg;
private IMock mock;
private IThingy thingy;
! [SetUp]
! public void SetUp()
{
cg = new ClassGenerator();
--- 73,83 ----
}
! [TestFixture] public class ClassGeneratorTest
{
private ClassGenerator cg;
private IMock mock;
private IThingy thingy;
! [SetUp] public void SetUp()
{
cg = new ClassGenerator();
***************
*** 89,94 ****
}
! [Test]
! public void CallMethodIsCalled()
{
mock.Expect("NoArgs");
--- 86,90 ----
}
! [Test] public void CallMethodIsCalled()
{
mock.Expect("NoArgs");
***************
*** 97,102 ****
}
! [Test]
! public void CallMethodWithReturn()
{
object x = "sdfs";
--- 93,97 ----
}
! [Test] public void CallMethodWithReturn()
{
object x = "sdfs";
***************
*** 107,112 ****
}
! [Test]
! public void CallMethodWithReturnAndCast()
{
string x = "sdfs";
--- 102,106 ----
}
! [Test] public void CallMethodWithReturnAndCast()
{
string x = "sdfs";
***************
*** 117,122 ****
}
! [Test]
! public void CallMethodWithWeirdObjectReturn()
{
IThingy t = thingy;
--- 111,115 ----
}
! [Test] public void CallMethodWithWeirdObjectReturn()
{
IThingy t = thingy;
***************
*** 127,132 ****
}
! [Test]
! public void CallMethodWithReturnInt()
{
mock.ExpectAndReturn("intReturn", 7);
--- 120,124 ----
}
! [Test] public void CallMethodWithReturnInt()
{
mock.ExpectAndReturn("intReturn", 7);
***************
*** 136,141 ****
}
! [Test]
! public void CallMethodWithReturnBoxings()
{
mock.ExpectAndReturn("boolReturn", true);
--- 128,132 ----
}
! [Test] public void CallMethodWithReturnBoxings()
{
mock.ExpectAndReturn("boolReturn", true);
***************
*** 146,151 ****
}
! [Test]
! public void CallMethodWithReturnEnum()
{
mock.ExpectAndReturn("getEnum", MyEnum.C);
--- 137,141 ----
}
! [Test] public void CallMethodWithReturnEnum()
{
mock.ExpectAndReturn("getEnum", MyEnum.C);
***************
*** 155,161 ****
}
! [Test]
! [ExpectedException(typeof(System.IO.IOException))]
! public void CallMethodTheThrowsException()
{
mock.ExpectAndThrow("boolReturn", new System.IO.IOException());
--- 145,149 ----
}
! [Test] [ExpectedException(typeof(System.IO.IOException))] public void CallMethodTheThrowsException()
{
mock.ExpectAndThrow("boolReturn", new System.IO.IOException());
***************
*** 163,170 ****
}
! [Test]
! public void CallMethodWithParamExpectations()
{
! mock.Expect("WithSimpleArg", new IsEqual("hello"));
thingy.WithSimpleArg("hello");
mock.Verify();
--- 151,157 ----
}
! [Test] public void CallMethodWithStringParameterExpectation()
{
! mock.Expect("WithSimpleArg", new StartsWith("he"));
thingy.WithSimpleArg("hello");
mock.Verify();
***************
*** 183,191 ****
thingy.WithIntParam(1);
mock.Verify();
! }
!
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void CallMethodWithParamExpectationsThatFails()
{
mock.Expect("WithSimpleArg", new IsEqual("hello"));
--- 170,175 ----
thingy.WithIntParam(1);
mock.Verify();
! }
! [Test] [ExpectedException(typeof(VerifyException))] public void CallMethodWithParamExpectationsThatFails()
{
mock.Expect("WithSimpleArg", new IsEqual("hello"));
***************
*** 194,199 ****
}
! [Test]
! public void CallMethodWithTwoParamExpectations()
{
mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world"));
--- 178,182 ----
}
! [Test] public void CallMethodWithTwoParamExpectations()
{
mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world"));
***************
*** 202,208 ****
}
! [Test]
! [ExpectedException(typeof(VerifyException))]
! public void CallMethodWithTwoParamExpectationsThatFails()
{
mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world"));
--- 185,189 ----
}
! [Test] [ExpectedException(typeof(VerifyException))] public void CallMethodWithTwoParamExpectationsThatFails()
{
mock.Expect("WithTwoArgs", new IsEqual("hello"), new IsEqual("world"));
***************
*** 211,216 ****
}
! [Test]
! public void CallMethodWithThreeParamExpectations()
{
mock.Expect("WithThreeArgs", new IsEqual("hello"), new IsEqual("the"), new IsEqual("world"));
--- 192,196 ----
}
! [Test] public void CallMethodWithThreeParamExpectations()
{
mock.Expect("WithThreeArgs", new IsEqual("hello"), new IsEqual("the"), new IsEqual("world"));
***************
*** 219,224 ****
}
! [Test]
! public void CallMethodWithLoadsOfParamExpectations()
{
mock.Expect("WithLotsOfArgs", new IsEqual("hello"), new IsEqual("world"), new IsEqual("is"), new IsEqual("this"), new IsEqual("the"), new IsEqual("end"));
--- 199,203 ----
}
! [Test] public void CallMethodWithLotsOfArgsExpectations()
{
mock.Expect("WithLotsOfArgs", new IsEqual("hello"), new IsEqual("world"), new IsEqual("is"), new IsEqual("this"), new IsEqual("the"), new IsEqual("end"));
***************
*** 227,232 ****
}
! [Test]
! public void CallMethodWithOtherArgs()
{
IList l = new ArrayList();
--- 206,210 ----
}
! [Test] public void CallMethodWithOtherArgs()
{
IList l = new ArrayList();
***************
*** 235,239 ****
mock.Verify();
}
!
[Test] public void CallMethodWithLongParam()
{
--- 213,222 ----
mock.Verify();
}
! [Test] public void CallMethodWithVariableNumberOfParams()
! {
! mock.Expect("WithParams", 1, new object[]{"string1", "string2"});
! thingy.WithParams(1, "string1", "string2");
! mock.Verify();
! }
[Test] public void CallMethodWithLongParam()
{
***************
*** 243,248 ****
}
! [Test]
! public void CallReadOnlyProperty()
{
mock.ExpectAndReturn("ReadProperty", "hello");
--- 226,230 ----
}
! [Test] public void CallReadOnlyProperty()
{
mock.ExpectAndReturn("ReadProperty", "hello");
***************
*** 253,258 ****
}
! [Test]
! public void WriteOnlyPropertyExpectations()
{
mock.Expect("WriteProperty", "hello");
--- 235,239 ----
}
! [Test] public void WriteOnlyPropertyExpectations()
{
mock.Expect("WriteProperty", "hello");
***************
*** 263,268 ****
}
! [Test]
! public void ReadAndWriteProperty()
{
mock.Expect("AProperty", "hello");
--- 244,248 ----
}
! [Test] public void ReadAndWriteProperty()
{
mock.Expect("AProperty", "hello");
***************
*** 277,282 ****
}
! [Test]
! public void ExtendClass()
{
cg = new ClassGenerator();
--- 257,261 ----
}
! [Test] public void ExtendClass()
{
cg = new ClassGenerator();
***************
*** 299,310 ****
}
! [Test] [ExpectedException(typeof(TypeLoadException))]
! public void CannotMockClassWithInternalMethodBecauseOfAssemblyVisibility()
{
new ClassGenerator().Generate(typeof(ClassWithInternalMethod), mock);
}
! [Test]
! public void CheckBoxingOpCodes()
{
BoxingOpCodes opCodes = new BoxingOpCodes();
--- 278,287 ----
}
! [Test] [ExpectedException(typeof(TypeLoadException))] public void CannotMockClassWithInternalMethodBecauseOfAssemblyVisibility()
{
new ClassGenerator().Generate(typeof(ClassWithInternalMethod), mock);
}
! [Test] public void CheckBoxingOpCodes()
{
BoxingOpCodes opCodes = new BoxingOpCodes();
***************
*** 323,327 ****
Assertion.AssertEquals( OpCodes.Ldind_I1, opCodes[typeof(bool)] );
}
-
}
--- 300,303 ----
|