autofixture Questions
1
Solved
I am writing unit tests for the existing Web API 2 project. For which i am using Ploeh Autofixture and Moq.
Test Method :
UPDATED
[Test]
public async Task Service1_TestMethod() {
//some code...
Puklich asked 18/8, 2016 at 10:21
2
Solved
I am trying to use autofixture to create an object but there are certain properties that I want to always be defaulted (while the rest could be auto generated). However, whenever I setup an customi...
Duad asked 31/7, 2016 at 22:34
2
Solved
Using AutoFixture I can easily create an instance of a data object using the Create method like so:
_fixture.Create<FilterItems>()
Using this technique I am protected for any changes in th...
Bimbo asked 25/7, 2016 at 10:34
1
Solved
I have a very simple test as shown below.
I try to freeze my two dependencies using the AutoDataAttribute + AutoMoqCustomization.
class AutoMoqDataAttribute : AutoDataAttribute
{
public AutoMoqD...
Supereminent asked 28/6, 2016 at 7:5
1
Solved
I'm working on a project where I have some recursive data structure and I want to create a fixture for it.
The data structure is XmlCommandElement, it has a single method ToCommand that converts X...
Sensual asked 2/6, 2016 at 7:8
2
Using AutoFixture with the AutoFixture.AutoMoq package, I sometimes find tests that weren't configured to correctly test the thing they meant to test, but the problem was never discovered because o...
Abjure asked 3/12, 2015 at 0:23
2
Solved
Suppose I'd like a call in a unit test to return an anonymous type that looks like this -
var anonymousType = { id = 45, Name="MyName", Description="Whatever" }
Could Autofixture generate anony...
Asthenic asked 11/4, 2016 at 15:4
1
Solved
I'm using xunit v2.1.0, xunit.extensions v1.8.0.1549, AutoFixture v3.40.0, AutoFixture.Xunit v3.40.0 and I have this simple trivial test that uses AutoData
using Ploeh.AutoFixture.Xunit;
using Xu...
Expostulate asked 8/3, 2016 at 19:31
1
Solved
How can I have AutoFixture populate properties in my object containing interface property?
public class Car : ICar
{
public string Name { get; set; }
public ICarinformation ContactInformation { ...
Isonomy asked 14/2, 2016 at 0:23
1
Solved
I'm trying to generate specific values for a class with AutoFixture but the Builder is given an abstract class. As such, the builder can't see the properties for either concrete types ... and there...
Edrisedrock asked 5/2, 2016 at 3:42
2
Solved
Are integer numbers generated with IFixture.Create<int>() unique?
The Wiki says that numbers are random, but it also tells us this
The first numbers are generated within the range of [1, ...
Bellbird asked 3/2, 2016 at 8:45
3
Solved
I am writing tests for class (lets call it Sut) which has some dependencies injected via constructors. For this class I have to use the constructor with the most parameters, therefore I used the Au...
Heterogamete asked 14/1, 2016 at 11:23
2
Solved
I've just created a new project in ASP 5 MVC 6 beta8 and a compatible class library for tests. The problem occurs in this new "Web Class Library" project that I intended to use for tests.
This is ...
Carinthia asked 25/10, 2015 at 0:0
2
Solved
How can I use custom ISpecimenBuilder instances along with the OmitOnRecursionBehavior which I want applied globally to all fixture-created objects?
I'm working with an EF Code First model with a...
Undistinguished asked 3/9, 2013 at 18:3
1
Solved
For example I've got these partial classes that was generated by EF Database First:
Dog: (EF entity)
public partial class Dog
{
public int DogID { get; set; }
public string Name { get; set; }
...
Winny asked 23/11, 2015 at 11:17
3
Solved
Consider the following classes:
public interface IInterface {}
public class Class : IInterface {}
public class Customization : ICustomization
{
readonly IInterface item;
public Customization()...
Stores asked 13/11, 2015 at 0:17
7
Solved
I am looking for a Java tool that would create anonymous variables (variables whose value I don't care about) in my tests, similar to AutoFixture in .Net. Here is a link to AutoFixture's read...
Hypogastrium asked 6/7, 2012 at 17:56
1
Solved
I am trying to compare 2 complex objects with AutoFixture's OfLikeness but unfortunately without success. While comparing nested objects( also with OfLikeness) works as expected, comparing a master...
Berna asked 5/11, 2015 at 10:26
1
Moq does not make recursive mocks by default. That is, for members without expectations on a mock, Moq returns default values. For example, given:
public interface IFoo
{
Bar Bar();
}
and
publ...
Bromoform asked 20/2, 2014 at 23:13
1
Solved
I'm currently using a test framework I've thrown together using xUnit, AutoMoq, AutoFixture, and AutoFixture.XUnit2. I'm running into issues with mocking methods with generic signatures.
AutoFixtu...
Heptangular asked 20/10, 2015 at 23:18
1
Solved
I am using AutoFixture with the AutoMoqCustomization and attempting to create an instance of a class which contains a readonly property thus:
public override ILog Logger { get; } = LogManager.GetL...
Forgotten asked 15/10, 2015 at 16:36
1
I want AutoFixture to generate two integers, and for the second one, I don't want it to be 0, or the previous generated number. Is there a way to tell AutoFixture to honor that "requirement".
Look...
Branle asked 25/9, 2015 at 11:18
1
The problem
I have a pretty big application that makes use of a bunch of other services.
For testing scenarios I don't want my unit tests to rely on third party systems, so I want to replace the s...
Weekender asked 2/10, 2013 at 20:48
1
How do I force AutoFixture, that has been configured with AutoConfiguredMoqCustomization, to automatically mock interfaces and its read-only properties?
To make things clear, let's assume I have s...
Goatish asked 18/8, 2015 at 8:48
2
Solved
I need to enable AutoFixture to create instances of types with circular references (from an API provided by a third party). To do this I can remove the default ThrowingRecursionBehavior as shown be...
Training asked 6/8, 2015 at 12:31
© 2022 - 2024 — McMap. All rights reserved.