20/05/2010 9:50:56 AM
 Arsène von Wyss Posts: 8
|
I've tried to convert some existing NUnit tests to T#. Now I have a class which loads data from a stream. For convenience and self-containment, I usually embed those files as resources into the test assembly so that the tests have no external dependency even though they load data from a stream.
Unfortunately, even after settings the file to "Embedded Resource" in the Project Explorer in Visual Studio, it is not embedded, which obviously leads to an invalid test (the testcontext step fails).
|
|
0
• permalink
|
20/05/2010 12:36:05 PM
 Ludovic Dubois Administrator Posts: 155
|
You are the first one asking for this functionality.  Thus, we will add it very soon.
|
|
0
• permalink
|
21/05/2010 9:41:54 AM
 Arsène von Wyss Posts: 8
|
Perfect!
However, I wonder what your suggestion is for testing stuff which involves reading from files/streams? Embedded Resources just feel natural to me because they have no dependencies on external resources; the file cannot be locked or missing, and they're really part of the test code assembly.
|
|
0
• permalink
|
21/05/2010 4:34:15 PM
 Ludovic Dubois Administrator Posts: 155
|
I agree. It's a great place for testing streams... if you do not have so much cases to test!  Otherwise, building cases in MemoryStream would be the best. Build exactly the case you want before runtest statement and test it...
|
|
0
• permalink
|
26/05/2010 3:06:42 PM
 Arsène von Wyss Posts: 8
|
One sample: I have written a engine for the GOLD Parser System. Now this application generates a binary table file with symbols and DFA and LALR states, which must be read by my engine in the first step fr further processing. So even though the contents of the file is well defined, there's no way that I'm going to create a MemoryStream with that data in code without going through great pain (decoding Base64 would be the best approach I guess). So alone for the table file reader I have quite a number of tests which ensure that the file is correctly loaded and symbols are present as expected - which is why the very same stream is read and used for a large number of tests.
|
|
0
• permalink
|
26/05/2010 3:32:04 PM
 Ludovic Dubois Administrator Posts: 155
|
That's fine.
I'm already working on it!
|
|
0
• permalink
|
28/05/2010 9:10:22 AM
 Ludovic Dubois Administrator Posts: 155
|
I don't know if you know that nightly builds are available?
I added resources in build 1107. Can you try it and tell me if it fixes your problem?
Thanks for making Visual T# better.
|
|
0
• permalink
|
05/08/2011 2:36:33 PM
 AvonWyss Posts: 1
|
I gave T# another go, because I love the concept and the included mocking functionality looks promising... But what happened is that I just ran into the same issue again: The embedded resources are still no being included (V2.0.2).
Also all the information entered in the AssemblyInfo.cs is not transferred into a version information resource.
|
|
0
• permalink
|
08/08/2011 11:36:43 AM
 Ludovic Dubois Administrator Posts: 155
|
AvonWyss wrote:
I gave T# another go, because I love the concept and the included mocking functionality looks promising... But what happened is that I just ran into the same issue again: The embedded resources are still no being included (V2.0.2).
Also all the information entered in the AssemblyInfo.cs is not transferred into a version information resource. I have added a bug in YouTrack
|
|
0
• permalink
|