Telerik blogs
  • Productivity Testing

    Is your test method self-validating ?

    Writing state of art unit tests that can validate your every part of the framework is challenging and interesting at the same time; it's like becoming a samurai. One of the key concept in this is to keep our test synced all the time as underlying code changes and thus breaking them to the furthest unit as possible.
    May 23, 2010
  • Productivity

    Mocking property sets

    In this post, i will be showing how you can mock property sets with your expected values or even action using JustMock. To begin, we have a sample interface: public interface IFoo {     int Value { get; set; } } Now,  we can create a mock that will throw on any call other than the one expected, generally its a strict mock and we can do it like: bool expected = false;  var foo = Mock.Create<IFoo>(BehaviorMode.Strict);  Mock.ArrangeSet(() => { foo.Value = 1; }).DoInstead(() => expected  = true);    foo.Value = 1;    Assert.True(expected); Here , the method for running though our expectation for set is Mock.ArrangeSet , where we can directly set our expectations or can even set matchers into...
    May 14, 2010
  • Productivity

    Playing with aspx page cycle using JustMock

    In this post , I will cover a test code that will mock the various elements needed to complete a HTTP page request and  assert the expected page cycle steps. To begin, i have a simple enumeration that has my predefined page steps: public enum PageStep {     PreInit,     Load,     PreRender,     UnLoad } Once doing so, i  first created the page object [not mocking]. Page page = new Page(); Here, our target is to fire up the page process through ProcessRequest call, now if we take a look inside the method with reflector.net,  the call trace will go like : ProcessRequest –> ProcessRequestWithNoAssert –>...
    April 29, 2010
  • Productivity

    JustCode &ndash; Color Identifiers in Depth

    Last time we looked at the basics of JustCode color identifiers. In this blog I will go a bit more in-depth about each of the available markers. There are quite a few, and we will be adding more as we mature JustCode.    What Do All of Those Markers DO? There are many markers listed in the “Display Item” list view, and you might not immediately know what some of these affect in the UI. That is why I have come up with this “cheat sheet” explaining each setting. Note: This code snippet contains at least one of every item JustCode colorizes. I turned off...
    April 28, 2010
  • Productivity

    JustCode &ndash; Color Identifier Basics

    Color identifiers make it easier for developers to quickly read and understand the code on screen.  One of the many features provided by JustCode is the ability to colorize additional items that Visual Studio does not allow you to colorize by default.  The colorization of items such as methods, properties, events, variables, and method parameters can easily be tweaked to your specific needs. Enable / Disable Color Identifiers In the recent release, we turned this option on by default.  You can enable/disable code colorization by going to the JustCode menu in Visual Studio, selecting options, then selecting the general section in...
    April 26, 2010