home recent topics recent posts search faq  

Pretty Objects Web Site :: Forum


register | lost password | open id open id
recent posts - RSS

Home » Recent messages

26/06/2010 8:21:31 AM
Topic:
Visual T# v1.9.2

Arsène von Wyss
Arsène von Wyss
Posts: 8
Great, downloading it right now.
23/06/2010 2:59:42 PM
Topic:
Visual T# v1.9.2

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
This new version of Visual T# is a minor release that enhance Visual Studio integration 


New features
  • Use upper case letters to search for name within Intellisense (for example: Console.WL [Ctrl]+[Space] will show you WindowLength, WriteLine ...)
  • Resources can now be integrated into T# projects
  • New item templates are now organized into Categories
Improvements
  • Project references are no more locked!
  • Intellisense now displays less stuff (only what is expected to show!). But Project References are still loaded from disk, even for projects in the same solution!
  • Code Completion for attributes does not add "Attribute" suffix
Bug Fixes
  • Minor bug fixes, especially in Intellisense

Go to the download forum and enjoy testing!
edited by Ludovic Dubois on 23/06/2010
23/06/2010 2:57:20 PM
Topic:
Visual T# v1.9.2

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
UPGRAGE YOUR VISUAL T# to v1.9.2 and have a better Visual Studio integration 

If this is the first time you install a language (other than Visual Studio ones), you have to run ProjectAggregator2.msi too. You can run it before or after installing Visual T#.
If you are not sure if you need to install it, run it: it will stops if there is nothing to do.

Note that you need VS2008 SP1 for installing Visual T# in Visual Studio 2008.
28/05/2010 9:10:22 AM
Topic:
Embedded resources

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
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.
26/05/2010 3:32:04 PM
Topic:
Embedded resources

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
That's fine.


I'm already working on it! 
26/05/2010 3:06:42 PM
Topic:
Embedded resources

Arsène von Wyss
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.
25/05/2010 9:46:06 AM
Topic:
Combining criteria with OR

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
See discussion at: TSHARP-147 
21/05/2010 4:34:15 PM
Topic:
Embedded resources

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
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...
21/05/2010 9:41:54 AM
Topic:
Embedded resources

Arsène von Wyss
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.
21/05/2010 9:38:45 AM
Topic:
Exception on compile

Arsène von Wyss
Arsène von Wyss
Posts: 8
Great, thanks! I'll add issues to the bug tracker in the future; I didn't know where else to post it than here.
20/05/2010 12:40:32 PM
Topic:
Syntax for test methods testing a constructor

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
You should use the name of the class, just like in C#.


testclass for Product
{
  test Product( string name, double price )
  {
    runtest Product p = new Product( "My Product", 123 );
    assert ...;
  }
}
20/05/2010 12:36:05 PM
Topic:
Embedded resources

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
You are the first one asking for this functionality. 
Thus, we will add it very soon.
20/05/2010 12:34:33 PM
Topic:
Exception on compile

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
The error message is here (last line): Z:\Test\TestClass.ts(10,14): error TS400090: '1' cannot be written to
But I agree: the exception should not be thrown!


I just add it to our bugs tracker system: http://bugs.prettyobjects.com 
We will resolve it soon, you can watch the issue if you want.
20/05/2010 11:03:37 AM
Topic:
Combining criteria with OR

Arsène von Wyss
Arsène von Wyss
Posts: 8
I have been trying to implement a test which uses the || criteria operator, closely following the following sample in the documentation:

testclass for Product {
test Price set
when MinIncluded.BelowMinCase
{
... // code testing negative price
}

test Price set
{
runtest ValidatePriceSet( 0 );
runtest ValidatePriceSet( 10 );
}

test Price set
signature ValidatePriceSet( double val )
when MinIncluded.IsMin || MinIncluded.IsAboveMin
{
Product p = new Product( "T#", 100 );
runtest p.Price = val;
assert p.Price == val;
}
}



One minor issue was that the signature which requires a "void" before the method name. That was quickly fixed.




However, now the tests still fail, I get a NullReferenceException which I have no idea what causes it. The test output is not helpful in locating the error and the debugger doesn't give me more information either; the following is in the output:





A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll

A first chance exception of type 'System.NullReferenceException' occurred in TSharp.dll

A first chance exception of type 'System.NullReferenceException' occurred in TSharp.dll

A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll




Here's my test code:



using System;
using System.IO;
using TSharp.Criteria;
using bsn.GoldParser.Grammar;

namespace bsn.GoldParserTest {
testclass for CompiledGrammar {
private CompiledGrammar grammar;

testcontext {
using (Stream stream = new FileStream(@"Z:\Test\TestGrammar.cgt", FileMode.Open)) {
grammar = CompiledGrammar.Load(stream);
}
runtest;
}

test TryGetSymbol(string symbolName, out Symbol)
when symbolName: ValidFormattedString.NullCase {
Symbol symbol;
bool result;
runtest result = grammar.TryGetSymbol(null, out symbol);
assert thrown ArgumentNullException;
}

test TryGetSymbol(string symbolName, out Symbol)
signature void ValidateTryGetSymbol(string symName)
when symbolName: ValidFormattedString.EmptyCase || ValidFormattedString.InvalidFormatCase {
Symbol symbol;
bool result;
runtest result = grammar.TryGetSymbol(symName, out symbol);
assert result == false;
assert symbol == null;
}

test TryGetSymbol(string symbolName, out Symbol) {
runtest ValidateTryGetSymbol(null);
runtest ValidateTryGetSymbol("invalid name");
}

test TryGetSymbol(string symbolName, out Symbol)
when symbolName: ValidFormattedString.IsValidFormat {
Symbol symbol;
bool result;
runtest result = grammar.TryGetSymbol("Integer", out symbol);
assert result == true;
assert symbol.Name == "Integer";
}
}
}

20/05/2010 9:53:35 AM
Topic:
Syntax for test methods testing a constructor

Arsène von Wyss
Arsène von Wyss
Posts: 8
When I declare a test, I can specify which method or property it tests. However, I have not been able to find a valid syntax to define that the constructor is to be tested, and the documentation doesn't seem to mention this either. So what's the best practice for testing those?
20/05/2010 9:50:56 AM
Topic:
Embedded resources

Arsène von Wyss
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).
20/05/2010 9:11:32 AM
Topic:
Exception on compile

Arsène von Wyss
Arsène von Wyss
Posts: 8
Using V1.9.1 build 1101.

I created a new test project with the following test (sorry for the formatting - does this forum support code blocks?):




using System;

using TSharp.Criteria;




namespace bsn.GoldParserTest

{

testclass

{

test

{

runtest 1=0;

}

}

}




I do know that it should be 1==0 instead of 1=0, but I didn't expect the compiler to throw a NullReferenceException:




Task "TSharpCompiler"

T# Compilation Task

C:\Program Files (x86)\MSBuild\Pretty Objects\TSharp\1.0\TSharp.targets(22,5): error : TSharpCompiler.Nodes.TSharpDebugException: Z:\Test\TestClass.ts(10,16): System.NullReferenceException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.

at TSharpCompiler.Nodes.Expressions.AssignmentExpression.get_HasSideEffects() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Expressions\AssignmentExpression.cs:line 106

at TSharpCompiler.Nodes.Expressions.Expression.ValidateUsage(Statement currentStatement) in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Expressions\Expression.cs:line 564

at TSharpCompiler.Nodes.Expressions.AssignmentExpression.ValidateUsage(Statement currentStatement) in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Expressions\AssignmentExpression.cs:line 242

at TSharpCompiler.Nodes.Expressions.Expression.SafeValidateUsage(Statement currentStatement) in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Expressions\Expression.cs:line 545

--- End of inner exception stack trace ---

at TSharpCompiler.Nodes.Expressions.Expression.SafeValidateUsage(Statement currentStatement) in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Expressions\Expression.cs:line 557

at TSharpCompiler.Nodes.Statements.ExpressionStatement.ValidateUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Statements\ExpressionStatement.cs:line 76

at TSharpCompiler.Nodes.Statements.Statement.SafeValidateUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Statements\Statement.cs:line 388

at TSharpCompiler.TSharpSpecific.RuntestStatement.ValidateUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\TSharpSpecific\RuntestStatement.cs:line 211

at TSharpCompiler.Nodes.Statements.Statement.SafeValidateUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Statements\Statement.cs:line 388

at TSharpCompiler.Nodes.Statements.CompositeStatement.ValidateUsage(StatementStatus& otherStatus) in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Statements\CompositeStatement.cs:line 311

at TSharpCompiler.Nodes.Statements.TopLevelBlockStatement.ValidateUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Statements\TopLevelBlockStatement.cs:line 155

at TSharpCompiler.Nodes.Statements.Statement.SafeValidateUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\Statements\Statement.cs:line 388

at TSharpCompiler.Nodes.CSI.MethodDeclaration.ValidateUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\CSI\MethodDeclaration.cs:line 443

at TSharpCompiler.TSharpSpecific.TestMethodDeclaration.ValidateUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\TSharpSpecific\TestMethodDeclaration.cs:line 461

at TSharpCompiler.Nodes.CSI.CSIDeclaration.ValidateMemberUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Nodes\CSI\CSIDeclaration.cs:line 2443

at TSharpCompiler.TSharpSpecific.TestClassDeclaration.ValidateUsage() in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\TSharpSpecific\TestClassDeclaration.cs:line 199

at TSharpCompiler.Compiler.TSCompiler.Compile(String projectPath, Program programToCompile, ICompilerStrategy strategy, Boolean reflectionOnly) in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharpCompiler\Compiler\TSCompiler.cs:line 224

at TSharp.MSBuild.Compiler.Compile(TaskLoggingHelper taskLogger, String projectPath, String[] constants, String[] sourceFiles, PEFileKinds targetKind, Boolean includeDebugInformation, String outputAssembly, IEnumerable assemblyFullNames, IEnumerable assemblyFileNames, String[] signatureFormats, String[] nameFormats) in C:\TeamCity\buildAgent\work\f825465bfabafd8d\TSharpComp\TSharp.MSBuild\Compiler.cs:line 67

Z:\Test\TestClass.ts(10,14): error TS400090: '1' cannot be written to
05/05/2010 10:45:56 PM
Topic:
Visual T# v1.9.1

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
This new version of Visual T# adds an exciting new feature you do not find in any other product:


New features
  • Generate missing test skeleton from Tests Explorer case (drag missing case and drop it in source code)
  • Select Tests Explorer test node and test case from source code (contextual menu: Visual T#|Select Test in Tests Explorer)
  • Retrieve case from Test Explorer test node (contextual menu 'Goto Case')
Improvements
  • Big refactoring for source and symbols management in Visual Studio (QuickInfo, Tool Tips, Code Completion, ClassView, DropDown, Tests Explorer...)
Bug Fixes
  • Minor bug fixes, particularly in Tests Explorer, Tests Runner (for Working Space)

Go to the download forum and enjoy testing!
05/05/2010 10:38:33 PM
Topic:
Visual T# v1.9.1

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
UPGRAGE YOUR VISUAL T# to v1.9.1 and generate tests skeleton by dragging test case from Live Tests Explorer to your source code! 

If this is the first time you install a language (other than Visual Studio ones), you have to run ProjectAggregator2.msi too. You can run it before or after installing Visual T#.
If you are not sure if you need to install it, run it: it will stops if there is nothing to do.

Note that you need VS2008 SP1 for installing Visual T# in Visual Studio 2008.
16/04/2010 5:09:07 PM
Topic:
Visual T# v1.9.0

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 88
This new version of Visual T# adds an exciting new feature you do not find in any other product:
New Features

  • Live 'Visual T# Tests Explorer': manage actual and missing tests as soon as you write them!
    Access it from the Visual T# contextual menu
Improvements

  • You can now stop test run from either Visual T# Contextual Menu or Test Explorer, when you run tests from either Contextual menu or Test Explorer.
Bug Fixes
  • Minor bug fixes


Go to the download forum and enjoy testing! 

Home » Recent messages





Powered by AspNetForum 6.6.5.0 © 2006-2010 Jitbit Software