Caves Travel Diving Graphics Mizar Texts Cuisine Lemkov Contact Map RSS Polski
Trybiks' Dive Texts VB.NET YAC Software
  Back

List

Charsets

Charts

DBExpress

Delphi

HTML

Intraweb

MSTest

PHP

Programming

R

Rhino Mocks

Software

Testing

UI Testing

VB.NET

VCL

WPF

VB.NET
  • AssertWasCalled and Methods Called Multiple Times
    AssertWasCalled allows you to check if the object's method was called during the test. Until now, in our tests, we were testing single calls to such methods; such checks will fail, however, if the method is called multiple times during the test (with the same parameter values). You can define additional parameters in AssertWasCalled calls that handle this situation.

  • AssertWas[Not]Called and Object Properties
    AssertWasCalled and AssertWasNotCalled allow you to check if the object's method was called during the test (or not). Checking access to object properties depends on their declaration: whether they're ReadOnly, WriteOnly, or read/write.

  • Rhino Mocks's AssertWasNotCalled
    AssertWasCalled allows you to check if the given method was called during the test. AssertWasNotCalled, on the other hand, allows you to check that a method was not called during the test.

  • PrivateObject and Out/ByRef parameters
    I got an interesting question to the previous article on PrivateObject: What about testing private/protected methods with Out/ByRef parameters?

  • PrivateObject, WithEvents, and generics
    In the previous texts on PrivateObject (here, here, and here) all examples dealt with simple fields and non-generic types. Moreover, the examples in the last text were a bit contrived - at least I have never found the need to access private members of base classes... I think. However, the solution discussed there will help in one particular example - accessing protected fields marked with WithEvents in base generic classes.

  • Accessing private members of base classes
    In the previous text on PrivateObject and PrivateType we saw how PrivateObject can be used to access private and protected members of an object under test. However, sometimes, you may also need to access some of the members of the object's ancestor. PrivateObject can still be used in that scenario - you just need to construct it using a PrivateType.

  • CA1800:DoNoCastUnnecessarily
    CA1800:DoNoCastUnnecessarily - an FxCop warning that's easily fixed (at least most of the time).

  • PrivateObject and WithEvents
    In the previous text on PrivateObject I described how private and protected members can be accessed in automated tests. There's one caveat to this - accessing fields declared WithEvents.

  • The creator of this fault did not specify a Reason.
    "The creator of this fault did not specify a Reason." - the one exception we don't have to worry about.

  • Accessing private and protected members - PrivateObject and PrivateType
    Need access to private / protected members of an object when doing unit tests? Use PrivateObject and PrivateType.

  • Saving / restoring window placements in .NET
    It seems that saving window positions and sizes (including the application's main window location) should be easy enough. But even now, after so many years of Windows programming, people get it wrong. But we need to remember about changing screen resolutions, switching from multiple to single monitors, connecting to a projector, etc. Saving the current window's location just ain't gonna do the trick...

  • Checking Property Change Notifications
    Worried about type safety of property change notifications (INotifyPropertyChanged) in your VB.NET apps? Six lines of code will help in making sure that those are, actually, defined correctly.

  • Rhino Mocks's AssertWasCalled in VB.NET
    Using a big new library in any project can be quite daunting. But, IMO, the best way to learn one is to just start using it. And then, after a while, the more advanced functions will become apparent. But where to start?

    In this text you'll find a gentle introduction to Rhino Mocks that shows the simplest scenario where the library can be used - creating object stubs to facilitate testing.

  • First steps with Rhino Mocks (in VB.NET)
    Using a big new library in any project can be quite daunting. But, IMO, the best way to learn one is to just start using it. And then, after a while, the more advanced functions will become apparent. But where to start?

    In this text you'll find a gentle introduction to Rhino Mocks that shows the simplest scenario where the library can be used - creating object stubs to facilitate testing.

  • Meaningful identifiers
    Meaningful identifiers in code - that's the standard mantra you hear for tech leads, no? But what does this actually mean? Here's a real world example where changing just the names of a couple of identifiers makes the code much more readable, and makes comments wholly unnecessary.

  • Public fields vs. properties
    Why define properties that directly access private fields? Does that really make our code better?
Top