tdd (3)

Developer homework test.

Below you can find a test I received via email long time ago. Also, in this attachment there‚Äôs what I think is a good solution, any tough or suggestion is appreciated ! Developer Homework Please write code to fulfill the requirements of the following user stories. We are looking for answers that demonstrate good test […]

Moq a Sub

While mocking a VB method I was getting the following error : ‘Public Function Setup(expression As System.Linq.Expressions.Expression(Of System.Action(Of EmailSender.IMailManager))) As Moq.Language.Flow.ISetup(Of EmailSender.IMailManager)’: Expression does not produce a value Here’s the moq setup : mailManager.Setup(Function(x) x.SendEmail(It.IsAny(Of MailManagerSettings))).Verifiable() Because the SendEmail method is a Sub instead of a Function. Let’s replace the Setup target Function with a […]

NUnit factories

I was getting mad to find out how to use factories on NUnit. I’ve been using factory methods with MBunit and they’re definetly helpful when you need to execute a test using several imputs. What was confusing me is the NUnit documentation: I’ve googled something like “NUnit factory” and the first results were pointing me […]