473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

serializing test objects

Hi all,
We decided to clear the test db more frequently and I was asked to serialize
som
test objects to make sure our unit testing continues to work after clearing
the db.

Does anyone have any advice on how to implement this?
I've decided on BinaryFormatter because I want to save private fields and
ReadOnly-
properties as well as Public Read/Write Properties.
The objects are modeled as a hierarchi, maincompany, subcompany etc.
Should I put them all in a collection and serialize it?
If I serialize only the MainCompany, the other(lower) objects doesn't seem
to be saved.

Grateful for any tip!
Best Regards,
kk
Feb 19 '08 #1
1 1229

I don't have a direct answer.

But I have some source code that would make for a good test run in your
situation.

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!114.entry

I have objects,collections of objects, and collections of objects have have
collections of objects.

You would have to strip the Xml serialize stuff and try binary, but most of
the work would be done.

But it would give you some testing ideas.

The children objects should definately serialize. A friendly reminder that
everything needs to be tagged with the [Serilizable] attribute.

...

Hopefully, someone else can chime in as well. But I thought I'd share what
I have.

...
"kkarre" <kk****@discussions.microsoft.comwrote in message
news:CF**********************************@microsof t.com...
Hi all,
We decided to clear the test db more frequently and I was asked to
serialize
som
test objects to make sure our unit testing continues to work after
clearing
the db.

Does anyone have any advice on how to implement this?
I've decided on BinaryFormatter because I want to save private fields and
ReadOnly-
properties as well as Public Read/Write Properties.
The objects are modeled as a hierarchi, maincompany, subcompany etc.
Should I put them all in a collection and serialize it?
If I serialize only the MainCompany, the other(lower) objects doesn't seem
to be saved.

Grateful for any tip!
Best Regards,
kk

Feb 19 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom Kent | last post by:
I have an array list of objects that I want to serialize into an XML file. I have tried this using the following code, but it gives me an error message An unhandled exception of type...
1
by: Ivo Bronsveld | last post by:
All, I have quite a challenging task ahead of me. I need to write an object model (for code access) based on a schema, which cannot be made into a dataset because of it's complexity. So I...
1
by: Lon | last post by:
Hello, Does anyone have any thoughts on copying graphics objects to the system clipboard? Specifically, I have a simple class that contains a GraphicsPath, a Pen, and Brush object. I'd like...
2
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: +...
4
by: Dave Veeneman | last post by:
When does serializing objects make more sense than persisting them to a database? I'm new to object serialization, and I'm trying to get a feel for when to use it. Here is an example: I'm...
4
by: Jason Shohet | last post by:
We are thinking of serializing an object & passing it toseveral functions on web service. This will happen about 35 times as the page loads. The class has about 20 attributes. We're not sure...
2
by: Dennis | last post by:
Does anyone know why this code gives an error: <serializeable> public structure TestSerialize anumber as integer astring as string end strucuture Dim t As TestSerialize Dim formatter As New...
47
by: Max | last post by:
Due to the behaviour of a particular COM object, I need to ensure that a request for a particular ASP page is finalized before another request for the page is processed. Does IIS have a way to...
5
by: | last post by:
I've got a basic "chat" infrastructure that can send objects across the wire, but I'm running into a few issues with trying to send multiple messages and things behaving differently in debug and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.