Telerik blogs

Latest

  • Productivity

    Mocking the File System to Improve Testability (with JustMock)

    Many applications require access to the file system to create, modify or delete files and folders. But how do you make sure that such application behaves correctly? You do it with tests of course but there is a catch: In general it is not a good idea to have tests that are performing Input/Output operations like accessing files and databases. When you need to test I/O operations mock objects are your friend. And before I go into more details let me point out some of the benefits of mocking. Usually faster than performing I/O operations You do not have have to deal...
    May 27, 2021 5 min read
  • Productivity

    Adding custom interfaces to your mock instance.

    Previously, i made a post  showing how you can leverage the dependent interfaces that is implemented by JustMock during the creation of mock instance. It could be a informative post that let you understand how JustMock behaves internally for classes or interfaces implement other interfaces into it. But the question remains, how you can add your own custom interface to your target mock. In this post, i am going to show you just that. Today, i will not start with a dummy class as usual rather i will use two most common interfaces in the .NET framework  and create a mock...
    May 27, 2021 2 min read
  • Productivity

    Using Telerik’s new LINQ Implementation Part I: Automatic Styles

    Last week Telerik released a service pack for OpenAccess Q1. The service pack fixes a few issues with Telerik’s new LINQ implementation working under Visual Studio 2010. In addition, the service pack shipped the Data Services Wizard; the Data Service Wizard is no longer a separate install. You can use the Data Service Wizard with traditional OpenAccess classes or the new LINQ implementation. Today I will show show you a new feature of the wizard: automatically creating a styled Silverlight application from your domain model. Future blog posts will show how to use RIA Services as well as SQL Azure. To get started open up Visual Studio 2010 and create...
    May 27, 2021 3 min read
  • Productivity Reporting

    An Overview of Connecting to Data and Using Expressions in Telerik Reporting Webinar

    Earlier today, I presented a webinar about Connecting to Data and Using Expression in Telerik Reporting. Thanks to everyone who attended and I hope you all learned something new. If you were unable to attend, the webinar has been recorded and is now available on Telerik TV. I've posted the link below. An Overview of Connecting to Data and Using Expression in Telerik Reporting The latest release of Telerik Reporting features two completely new data source components, the SqlDataSource component and the ObjectDataSource component. These components make it easy to bind to Business Objects or ADO.NET supported databases. Once a ...
    May 27, 2021 1 min read
  • Productivity

    Mocking successive calls of similar type via sequential mocking

    In this post , i show how you can benefit from  sequential mocking feature[In JustMock] for setting up expectations with successive calls of same type.  To start let’s first consider the following dummy database and entity class. public class Person {     public virtual string Name { get; set; }     public virtual int Age { get; set; } } public interface IDataBase {     T Get<T>(); }   Now, our test goal is to return different entity for successive calls on IDataBase.Get<T>(). By default, the behavior in JustMock is override , which is similar to other popular mocking tools. By override it means that the tool will consider always the latest user setup. Therefore, the first example will return the latest entity every-time and...
    May 27, 2021 2 min read