1

I am trying to learn F# via TDD.

However, I am struggling to write my first test:

module MSTest
    open Microsoft.VisualStudio.TestTools.UnitTesting

    [<TestClass>] type CalculatorShould () = 
        [<TestMethod>] member this.''add 1 and 2 with result of 3'' () = Assert.AreEqual(3, 1 + 2) 

Any ideas on how to do this?

I receive the following errors:

Error A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'.

Error Unexpected quote symbol in member definition. Expected identifier, '(', '(*)' or other token.

Error 'get' and/or 'set' required c:\Users\Bizmonger\Documents\Visual Studio 2015\Projects\FSharpModel\Tests_MyTest.fs 5 Error This is not a valid numeric literal. Sample formats include 4, 0x4, 0b0100, 4L, 4UL, 4u, 4s, 4us, 4y, 4uy, 4.0, 4.0f, 4I.

1 Answer 1

1

I was using the wrong set of characters.

I had to replace

''

with

``

Sign up to request clarification or add additional context in comments.

1 Comment

If this answered your question, you should mark it as answered. That's perfectly OK to do, even if when you're answering your own question. You may even get a badge for it :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.