Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Community Bloggers

Tuesday, August 05, 2008 - Posts

  • jMetronome: Using jQuery to keep typographic rhythm

    A couple of years ago, Richard Rutter wrote Compose to a Vertical Rhythm, which described how web developers could use CSS to maintain proper vertical typographic rhythm when designing pages. The technique is fairly straightforward, requiring some basic math to ensure consistent margins and leading across all page elements. One issue that many people face with [...] Read More...
  • Write your own NUnit constraint (in VB) - Part 1

    NUnit constraints offer a different style to crafting your unit tests, rather than write. Assert.IsEqual( expected,actual ) you could write Assert.That( expected , Is.EqualTo( actual )) Or in VB as Is is a reserved keyword - Assert.That( expected , [Is].EqualTo( actual )) 'Is' is one of the syntax helpers within NUnit.Framework.SyntaxHelpers to add a little syntax sugar, the above could be written as Assert,That(expected, new EqualConstraint( actual )) Where EqualConstraint lives in NUnit.Framework.Constraints but the syntax sugar is so much nicer. The That assert takes a IConstraint interface and if you want to craft your own constraints you can do so by using NUnit's own Constraint class. For our own purposes let's create a custom constraint that tests the cast of null (nothing) to a datetime value. Imports NUnit.Framework Imports NUnit.Framework.Constraints Public Class DateFormatConstraint Inherits Constraint Private testDate As Date Public Sub New() Me.testDate = CType(Nothing, Date) Read More...
  • NUnit constraints broke my R#

    After writing some NUnit tests with the Assert.That constriant syntax my code file was looking a bit messy so I ran R# 'cleanup' and it threw "JetBrains.Util.LoggerException: Cannot create IReferenceExpresion for 'Is' ". After that right click was kept throwing this error and to get around it I had to unload and reload the R# plugin. Not sure if it's VB and the need the escape Is as a reserved keyword but R# was struggling. Read More...

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us