Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

F# variable identifiers with dots
marhoily
#1 Posted : Friday, April 25, 2014 7:45:15 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/2/2012(UTC)
Posts: 13

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
NCrunch does not run Xunit facts that have dot '.' symbol in the double backslashed name. This standard sample just does not work with NCrunch because both tests have dots in the end

namespace Studyin.Tests

open Xunit
open FsUnit.Xunit

type LightBulb(state) =
member x.On = state
override x.ToString() =
match x.On with
| true -> "On"
| false -> "Off"

type ``Given a LightBulb that has had its state set to true``() =
let lightBulb = new LightBulb(true)

[<Fact>]
member test.``when I ask whether it is On it answers true.``() =
lightBulb.On |> should be True

[<Fact>]
member test.``when I convert it to a string it becomes "On."``() =
string lightBulb |> should equal "On"
Remco
#2 Posted : Saturday, April 26, 2014 12:10:52 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi,

Thanks for sharing this issue. Based on your example I've been able to quickly reproduce it.

NCrunch is making assumptions about method names based on the rules set down by C#. It isn't possible to create methods containing the period character or spaces in C#. F# makes this possible, and I can see the benefit of this as it allows tests to be named much more concisely.

I'll need to arrange a fix for this, though it may take some time. Is this a blocking issue for you?
Remco
#3 Posted : Monday, May 12, 2014 9:30:49 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download