Phillip Trelford's blog articles

0
comment
on 3/31/2013 2:25 PM
JavaScript is good, so JavaScript the good parts must be really good, so it follows that as part of JavaScript the Good Parts, prototypal inheritance must be really, really good. Some time ago while I was working on a supply chain management system for a large UK based department store I came across some interesting C# code, here’s an example:public class Customer : Address { } Unfortunately Clarence above has no address, but thanks to Homeless Hotspots he is a Mac address. A stark warning of the impli[...]
>> Read the full article
.
0
comment
on 3/28/2013 1:05 AM
F# 3 brings first-class support for LINQ Expressions, which makes working with libraries like Moq and FluentValidation easy. A while back I wrote about using Moq with F# 3 and introduced some extension methods to improve the experience for F#. I’ve created a small project called the Moq.FSharp.Extensions currently hosted on BitBucket (the library is about 50 lines of code in a single file), it is also available to download as a Nuget package. End extension One thing that was bugging me about using Moq i[...]
>> Read the full article
.
0
comment
on 2/20/2013 9:08 AM
On Tuesday I did a lightning talk at the MVP Summit in Bellevue on connecting to all things, from statistics to statistical programming languages with Intellisense and LINQ using F# Type Providers, a feature shipped with Visual Studio 2012:   Connecting to an Excel file: Querying users stored on SQL Azure: query { for u in db.Users do where (u.UserId <> userId) select u } Querying genres via the Netflix API: query { for g in ctx.Genres do where (g.Name = genre) for t in g.Tit[...]
>> Read the full article
.
0
comment
on 2/12/2013 11:43 PM
Foq is an open source .Net mocking library with a familiar fluent API for Moq users that lets you setup mock object using either LINQ or F# Code Quotations. Moq was developed to take advantage of .Net 3.5 LINQ expression trees and C# 3.0 features. Foq has been designed to provide first-class support for users of both C# and F#. C# users can use the LINQ API while F# users can choose between the LINQ API and Code Quotations. We use F# as a unit testing language at work and Foq for mocking code written in bo[...]
>> Read the full article
.
0
comment
on 1/26/2013 5:27 PM
F# 3 has LINQ expression support built-in just like C# and VB.Net. Prior to this basic LINQ expression interop could be achieved with the F# PowerPack and F# Code Quotations. F# 3 LINQ support opens up APIs that use LINQ expressions like Moq, a popular .Net mocking library. With some minor workarounds Moq is relatively easy to call from F#. C# Moq example: var mock = new Mock<IFoo>(); mock.Setup(foo => foo.DoSomething("ping")).Returns(true); F# requires a type annotation: F# requires the return va[...]
>> Read the full article
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper