Skip to content

Commit

Permalink
ported tests to nunit 2.5
Browse files Browse the repository at this point in the history
git-svn-id: https://iiop-net.svn.sourceforge.net/svnroot/iiop-net/trunk@2029 b113d865-ab28-0410-9ae9-d2690f63996d
  • Loading branch information
Alexander Kornienko committed Apr 24, 2011
1 parent bcb76bd commit 08874d8
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 313 deletions.
2 changes: 1 addition & 1 deletion IIOPNet/IntegrationTests/Callback/TestClient/Makefile
Expand Up @@ -31,7 +31,7 @@ $(bin)IIOPChannel.dll: $(IIOPCHANNEL)

$(bin)ClientTest.dll: $(bin)IIOPChannel.dll $(bin)Client.dll *.cs
$(CSC) $(CSFLAGS) /t:library /r:$(NUNIT_FRAMEWORK_DLL) /r:$(bin)IIOPChannel.dll /r:$(bin)Client.dll /out:$(bin)ClientTest.dll TestClient.cs

copy $(NUNIT_FRAMEWORK_DLL) $(bin)

start-client:
@echo "Callback IntegrationTest"
Expand Down
12 changes: 6 additions & 6 deletions IIOPNet/IntegrationTests/Callback/TestClient/TestClient.cs
Expand Up @@ -66,16 +66,16 @@ public class TestClient {
}

[TearDown]
public void TearDownEnvironment() {
m_testService = null;
ChannelServices.UnregisterChannel(m_channel);
public void TearDownEnvironment() {
m_testService = null;
ChannelServices.UnregisterChannel(m_channel);
}

[Test]
public void TestWithoutCallback() {
System.Byte arg = 1;
System.Byte result = m_testService.TestIncByte(arg);
Assertion.AssertEquals((System.Byte)(arg + 1), result);
Assert.AreEqual(arg + 1, result);
}

[Test]
Expand All @@ -85,7 +85,7 @@ public class TestClient {

System.Int32 arg = 1;
System.Int32 result = m_testService.IncrementWithCallbackIncrementer(arg);
Assertion.AssertEquals((System.Int32)(arg + 1), result);
Assert.AreEqual(arg + 1, result);
}

#endregion IMethods
Expand All @@ -103,7 +103,7 @@ public class CallbackIntIncrementerImpl : MarshalByRefObject, CallbackIntIncreme
public override object InitializeLifetimeService() {
// live forever
return null;
}
}

}

Expand Down
1 change: 1 addition & 0 deletions IIOPNet/IntegrationTests/CodeSets/TestClient/Makefile
Expand Up @@ -30,6 +30,7 @@ $(bin)IIOPChannel.dll: $(IIOPCHANNEL)

$(bin)ClientTest.dll: $(bin)IIOPChannel.dll $(bin)Client.dll *.cs
$(CSC) $(CSFLAGS) /t:library /r:$(NUNIT_FRAMEWORK_DLL) /r:$(bin)IIOPChannel.dll /r:$(bin)Client.dll /out:$(bin)ClientTest.dll TestClient.cs
copy $(NUNIT_FRAMEWORK_DLL) $(bin)


start-client:
Expand Down
30 changes: 15 additions & 15 deletions IIOPNet/IntegrationTests/CodeSets/TestClient/TestClient.cs
Expand Up @@ -73,75 +73,75 @@ public class TestClient {
[TearDown]
public void TearDownEnvironment() {
m_testService = null;
// unregister the channel
// unregister the channel
ChannelServices.UnregisterChannel(m_channel);
}

[Test]
public void TestChar() {
System.Char arg = 'a';
System.Char result = m_testService.TestEchoChar(arg);
Assertion.AssertEquals(arg, result);
Assert.AreEqual(arg, result);
arg = '0';
result = m_testService.TestEchoChar(arg);
Assertion.AssertEquals(arg, result);
Assert.AreEqual(arg, result);

arg = '0';
result = m_newTestService.TestEchoChar(arg);
Assertion.AssertEquals(arg, result);
Assert.AreEqual(arg, result);
}

[Test]
public void TestString() {
System.String arg = "test";
System.String toAppend = "toAppend";
System.String result = m_testService.TestAppendString(arg, toAppend);
Assertion.AssertEquals(arg + toAppend, result);
Assert.AreEqual(arg + toAppend, result);

System.String result2 = m_newTestService.TestAppendString(arg, toAppend);
Assertion.AssertEquals(arg + toAppend, result2);
Assert.AreEqual(arg + toAppend, result2);
}

[Test]
public void TestWChar() {
System.Char arg = 'a';
System.Char result = m_testService.TestEchoWChar(arg);
Assertion.AssertEquals(arg, result);
Assert.AreEqual(arg, result);
arg = '0';
result = m_testService.TestEchoWChar(arg);
Assertion.AssertEquals(arg, result);
Assert.AreEqual(arg, result);

arg = '0';
result = m_newTestService.TestEchoWChar(arg);
Assertion.AssertEquals(arg, result);
Assert.AreEqual(arg, result);
}

[Test]
public void TestWString() {
System.String arg = "test";
System.String toAppend = "toAppend";
System.String result = m_testService.TestAppendWString(arg, toAppend);
Assertion.AssertEquals(arg + toAppend, result);
Assert.AreEqual(arg + toAppend, result);

System.String result2 = m_newTestService.TestAppendWString(arg, toAppend);
Assertion.AssertEquals(arg + toAppend, result2);
Assert.AreEqual(arg + toAppend, result2);
}

[Test]
public void TestCodeSetComponent() {
IOrbServices orb = OrbServices.GetSingleton();
string iorString = orb.object_to_string(m_newTestService);
Ior ior = new Ior(iorString);
Assertion.Assert("nr of profiles", ior.Profiles.Length > 0);
Assert.IsTrue(ior.Profiles.Length > 0, "nr of profiles");
IIorProfile profile = ior.Profiles[0];
omg.org.IOP.CodecFactory codecFactory = (omg.org.IOP.CodecFactory)
orb.resolve_initial_references("CodecFactory");
object codeset =
profile.TaggedComponents.GetComponentData(1, codecFactory.create_codec(new omg.org.IOP.Encoding(omg.org.IOP.ENCODING_CDR_ENCAPS.ConstVal, 1, 2)),
CodeSetComponentData.TypeCode);
Assertion.AssertNotNull(codeset);
Assertion.AssertEquals((int)CharSet.UTF8, ((CodeSetComponentData)codeset).NativeCharSet);
Assertion.AssertEquals((int)WCharSet.UTF16, ((CodeSetComponentData)codeset).NativeWCharSet);
Assert.NotNull(codeset);
Assert.AreEqual((int)CharSet.UTF8, ((CodeSetComponentData)codeset).NativeCharSet);
Assert.AreEqual((int)WCharSet.UTF16, ((CodeSetComponentData)codeset).NativeWCharSet);
}


Expand Down
1 change: 1 addition & 0 deletions IIOPNet/IntegrationTests/Direct/TestClient/Makefile
Expand Up @@ -26,6 +26,7 @@ $(bin)TestServiceCommon.dll: $(TestService)

$(bin)ClientTest.dll: $(bin)IIOPChannel.dll $(bin)TestUnion.dll $(bin)TestServiceCommon.dll *.cs
$(CSC) $(CSFLAGS) /t:library /r:$(NUNIT_FRAMEWORK_DLL) /r:$(bin)TestUnion.dll /r:$(bin)TestServiceCommon.dll /r:$(bin)IIOPChannel.dll /out:bin\ClientTest.dll TestClient.cs
copy $(NUNIT_FRAMEWORK_DLL) $(bin)

start-client:
@echo "Direct IntegrationTest"
Expand Down

0 comments on commit 08874d8

Please sign in to comment.