public static void CanRoundTrip_PublicClass_PublicTestMethod() { var testCase = TestableTestMethodTestCase.Create <Serialization>("CanRoundTrip_PublicClass_PublicTestMethod"); var serialized = XunitSerializationInfo.Serialize(testCase); var deserialized = XunitSerializationInfo.Deserialize(typeof(TestableTestMethodTestCase), serialized); Assert.NotNull(deserialized); }
public static void UniqueID_Arguments() { var value42 = TestableTestMethodTestCase.Create <ClassUnderTest>("TestMethod", new object[] { 42 }).UniqueID; var valueHelloWorld = TestableTestMethodTestCase.Create <ClassUnderTest>("TestMethod", new object[] { "Hello, world!" }).UniqueID; var valueNull = TestableTestMethodTestCase.Create <ClassUnderTest>("TestMethod", new object[] { (string)null }).UniqueID; Assert.NotEmpty(value42); Assert.NotEqual(value42, valueHelloWorld); Assert.NotEqual(value42, valueNull); }
public static void CanRoundTrip_PublicClass_PublicTestMethod() { var serializer = new BinaryFormatter(); var testCase = TestableTestMethodTestCase.Create <Serialization>("CanRoundTrip_PublicClass_PublicTestMethod"); var memoryStream = new MemoryStream(); serializer.Serialize(memoryStream, testCase); memoryStream.Position = 0; serializer.Deserialize(memoryStream); // Should not throw }
public static void CanRoundTrip_PublicClass_PrivateTestMethod() { var serializer = new BinaryFormatter(); var testCase = TestableTestMethodTestCase.Create <Serialization>("CanRoundTrip_PublicClass_PrivateTestMethod"); var memoryStream = new MemoryStream(); serializer.Serialize(memoryStream, testCase); memoryStream.Position = 0; Assert.DoesNotThrow(() => serializer.Deserialize(memoryStream)); }
public static void UniqueID_NoArguments() { var value = TestableTestMethodTestCase.Create <ClassUnderTest>("TestMethod").UniqueID; Assert.NotEmpty(value); }