Release 1.3

Rating: No reviews yet
Downloads: 29
Change Set: 365d7d23aab8
Released: Oct 23, 2013
Updated: Oct 23, 2013 by ptrelford
Dev status: Stable Help Icon

Recommended Download

Source Code Foq.fs
source code, 44K, uploaded Oct 23, 2013 - 23 downloads

Other Available Downloads

Application Foq.dll
application, 145K, uploaded Oct 23, 2013 - 6 downloads

Release Notes

Support for non-tupled arguments (thanks BlackwaterPark):
type IDummy = 
  abstract member Add : Int32 -> Int32 -> Int32

let mock = 
  Mock<IDummy>()
    .Setup(fun dummy -> <@ dummy.Add 1 2 @>)
    .Returns(3)
    .Create()


Plus new example for Mock.With using a setup function:
let membersSetup (xs:IList<char>) =
    <@ xs.Count --> 2 
       xs.Item(0) --> '0'
       xs.Item(1) --> '1'
       xs.Contains(any()) --> true
     @>

let ``test mock with multiple members via setup function`` () =
    let xs = Mock.With(membersSetup)           
    Assert.AreEqual(2, xs.Count)
    Assert.AreEqual('0', xs.Item(0))
    Assert.AreEqual('1', xs.Item(1))
    Assert.AreEqual(true, xs.Contains('0'))

Reviews for this release

No reviews yet for this release.