Comments (6)
/cc @bradwilson can we just ToString()
other types used in this context for the display names?
from devices.xunit.
This is not about display names; this is about the fact that the theory data is not serializable.
from devices.xunit.
If the custom types implemented IXunitSerializable
, would it work better?
from devices.xunit.
Yes.
from devices.xunit.
I wrote a wrapper object that implements the IXunitSerializable interface and that corrected this issue for me. Sorry for the bother. I partially modified code I saw Brad posted here: xunit/xunit#429
public class MemberDataObject : IXunitSerializable
{
public MemberDataObject() { } // Needed for deserializer
public MemberDataObject(object pTestObject)
{
TestObject = pTestObject;
TestObjectName = TestObject.GetType().Name;
}
public object TestObject { get; private set; }
public string TestObjectName { get; private set; }
public void Deserialize(IXunitSerializationInfo serializationInfo)
{
TestObject = serializationInfo.GetValue<string>("TestObjectName");
}
public void Serialize(IXunitSerializationInfo serializationInfo)
{
serializationInfo.AddValue("TestObjectName", TestObjectName);
}
public override string ToString()
{
return TestObjectName + "()";
}
public T GetObject<T>()
{
if (TestObject is T)
return (T)TestObject;
else
return default (T);
}
}
Edit: Copied the wrong implementation; that one had errors. This one works.
from devices.xunit.
Thanks, closing this out then.
from devices.xunit.
Related Issues (20)
- Help with how to use ResultChannel HOT 1
- .txt file not inserted into project on install HOT 1
- iOS 13 can't run test project
- Accessibility problems on Windows Runner
- Testing UWP app fails to start HOT 1
- VS runner does not resolve on netstandard2.0 targets. HOT 2
- Failed MemberData doesn't show in runner app HOT 1
- Visual Studio for Mac
- Extremely poor performance, tests do not complete
- Is Devices.XUnit still be maintained?
- DotNet Maui HOT 1
- Support net6.0+ iOS/Android projects HOT 1
- UWP test runners do not work on Visual Studio 2022 HOT 2
- How do I view/display test results?
- Ability to filter tests HOT 1
- UnitTests from UWP command line
- Device runner for macOS? HOT 6
- Wrong version of xunit.runner.utility.netstandard installed with the latest package version HOT 1
- Test Automation HOT 4
- Templates out of date
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devices.xunit.