tagged [tdd]
C# "internal" access modifier when doing unit testing
C# "internal" access modifier when doing unit testing I'm trying to figure out if I should start using more of `internal` access modifier. I know that if we use `internal` and set the assembly variabl...
- Modified
- 29 Dec at 00:9
How do I apply unit testing to C# function which requires user input dynamically?
How do I apply unit testing to C# function which requires user input dynamically? The function below gets input from the user. I need to test this function using `Unit Testing`. Can anyone tell me how...
- Modified
- 17 Apr at 10:25
Static class/method/property in unit test, stop it or not
Static class/method/property in unit test, stop it or not Should a static class/method/property be used in a unit test development environment, given that there is no way to test it without introducin...
- Modified
- 3 Jul at 01:17
Visual Studio TDD setup
Visual Studio TDD setup I'm a C# developer new to TDD willing to experiment with this development methodology. My current setup is Visual Studio 2010 + Resharper (very convenient for running Unit Test...
- Modified
- 10 Jul at 16:52
MSTest Code Coverage
MSTest Code Coverage Is there a way to test code coverage within visual studio if I'm using MSTest? Or do I have to buy NCover? Is the NCover Enterprise worth the money or are the old betas good enoug...
- Modified
- 28 Mar at 05:28
TDD in a rest api
TDD in a rest api I am developing a Rest api with ServiceStack. I'm doing a tdd aproach, and write tests with each new service I implement. My DAL is pretty thin, with my repositories consisting of on...
- Modified
- 6 Feb at 23:28
What do programmers mean when they say, "Code against an interface, not an object."?
What do programmers mean when they say, "Code against an interface, not an object."? I've started the very long and arduous quest to learn and TDD to my workflow. I'm under the impression that TDD fit...
- Modified
- 3 Sep at 16:10
Moving existing code to Test Driven Development
Moving existing code to Test Driven Development Having recently discovered this method of development, I'm finding it a rather nice methodology. So, for my first project, I have a small DLL's worth of...
Is it OK to copy & paste unit-tests when the logic is basically the same?
Is it OK to copy & paste unit-tests when the logic is basically the same? I currently have like 10 tests that test whenever my Tetris piece doesn't move left if there is a piece in the path, or a wall...
- Modified
- 26 Aug at 20:11
How to check if method has an attribute
How to check if method has an attribute I have an example class Now what I want is to write a function returning true/false that can be executed like this ``` var controller
- Modified
- 26 Feb at 20:52
Setup method in Moq, ambiguous call
Setup method in Moq, ambiguous call I'm trying to use Moq to mock the interface: and I'm doing: But it doesn't even compile because of the error: > error CS0121:
Using RhinoMocks, how do you mock or stub a concrete class without an empty constructor?
Using RhinoMocks, how do you mock or stub a concrete class without an empty constructor? Mocking a concrete class with Rhino Mocks seems to work pretty easy when you have an empty constructor on a cla...
- Modified
- 2 Feb at 23:28
C# Extension method for checking attributes
C# Extension method for checking attributes Sorry if this is a stupid noob question please be gentle with me I'm trying to learn... I want to test against the attribute methods of things like models a...
- Modified
- 13 Aug at 12:27
How to MOQ an Indexed property
How to MOQ an Indexed property I am attempting to mock a call to an indexed property. I.e. I would like to moq the following: and also the setter value I am doing this because I need to mock the funct...
Unit testing the Viewmodel
Unit testing the Viewmodel I am sort of new to TDD. I have started creating the properties I need on the view model as plain auto property. Then I create a test ``` [TestMethod] [Tag("Property")] publ...
- Modified
- 6 Mar at 08:43
How to deal with interface overuse in TDD?
How to deal with interface overuse in TDD? I've noticed that when I'm doing TDD it often leads to a very large amount of interfaces. For classes that have dependencies, they are injected through the c...
- Modified
- 25 Mar at 08:24
The specified object is not recognized as a fake object. Issue
The specified object is not recognized as a fake object. Issue I am having an issue where a FakeItEasy call in an extremely simple test is failing with the error "The specified object is not recognize...
- Modified
- 5 Apr at 18:16
Can someone explain "Fake it till you make it" approach in Test Driven Development?
Can someone explain "Fake it till you make it" approach in Test Driven Development? I have a problem to understand the evolution of code when you have taken the "Fake It Until You Make IT" TDD approac...
- Modified
- 12 Nov at 16:30
First TDD test with no assert/expected exception. Is it worth it?
First TDD test with no assert/expected exception. Is it worth it? Let's say I'm starting to do a game with TDD. Is this a good first test? It basically forces me to define 3 things: the `Tetris` class...
- Modified
- 31 Jul at 22:57
Unit-tests and validation logic
Unit-tests and validation logic I am currently writing some unit tests for a business-logic class that includes validation routines. For example: Should my test fixture contain
- Modified
- 8 Jan at 15:1
TestContext in Visual Studio - What does it do?
TestContext in Visual Studio - What does it do? Test classes generated by Visual Studio usually have a `TestContext` property, as follows: [What MSDN had to say about this](http://msdn.microsoft.com/e...
- Modified
- 23 Nov at 21:6
Best way to do TDD in express versions of visual studio(eg VB Express)
Best way to do TDD in express versions of visual studio(eg VB Express) I have been looking in to doing some test driven development for one of the applications that I'm currently writing(OLE wrapper f...
- Modified
- 3 Nov at 09:25
C# - Asserting two objects are equal in unit tests
C# - Asserting two objects are equal in unit tests Either using Nunit or Microsoft.VisualStudio.TestTools.UnitTesting. Right now my assertion fails. ``` [TestMethod] public void GivenEmptyBoardExpec...
- Modified
- 8 May at 01:0
Run unit test before check in
Run unit test before check in Using Visual Studio and TFS & preferably Specflow or standard unit test. I want devs to run ALL unit test as a policy before check in. If a unit test breaks, then vS shou...
- Modified
- 19 Oct at 19:23