Telerik blogs
  • Productivity

    Mocking LINQ to SQL [Continued…] using RLINQ

    After making the post on mocking LINQ to SQL, this morning i was having a chat with Stephen forte and come to know that telerik a has product named RLINQ. RLINQ is built on top of OpenAccess and it supports variety of databases. Being curious, i thought of giving a spin with it and may be try to mock its LINQ to SQL implementation using JustMock.   Now, before i start, i also found that OpenAccess has a free / express version that works on top express database [Ex.sqlexpress] but supports all the features that full version offers. I will be using the...
    May 27, 2021 3 min read
  • Productivity

    JustMock. The tale continues... (Part 3)

    Last time we saw how we can inject code at the beginning of generic methods. Today I will show you how to inject code in properties. I will cover the syntax for static classes as well. So, let's start with a demo program that I will explain line-by-line. using System; using Telerik.CodeWeaver.Hook;   namespace ConsoleApplication4 {     public sealed class TargetClass1     {         public TargetClass1(string text)         {             Text = InitText = text;         }           public string InitText { get; private set;...
    May 27, 2021 4 min read
  • Productivity Testing

    Unit testing LINQ to SQL

    Unit testing LINQ to SQL repositories can be very challenging. Unit testing such requires faking hard to mock classes and requires simulation to return your custom data for a particular LINQ statement. In this post, i will show how you can mock your LINQ repositories easily without much digging in. As,  i was goggling [my start page is bing, its a matter of time when i will be bing-ing :-)] around, found a nice post by Ronnie Holm, where he shows how to unit test a  LINQ to SQL repository. I will follow his trail and use some of the codes...
    May 27, 2021 2 min read
  • Productivity

    Fun with pointers in C#

    Disclaimer: this post is all about fun. It is not about: turning a bug into a feature; some new isolation/mocking practice; wow, look what I will do with pointers in my next project; It is all about fun :)
    May 27, 2021 4 min read
  • Productivity

    JustMock. The tale continues... (Part 2)

    [Want to see JustMock in action? Register for the free webinar this Thursday, Jul 22, 11 am EST and check out What’s New in JustCode, JustMock, and OpenAccess ORM. During the live event attendees will also have the chance to win a Telerik Ultimate Collection (valued at $1999).]   In JustMock. The tale continues... (Part 1) we saw how we can inject prologue/epilogue code in .NET methods with JustMock. We covered the most simplest scenarios and some more complex ones as methods with ref/out parameters. Today I will show you how to do code injections in generic methods. Basically there is nothing new. We are already familiar with: AtStartOfAction AtStartOfFunc AtEndOfAction AtEndOfFunc etc. and last time...
    May 27, 2021 5 min read