autofixture Questions

1

Solved

I'm using the latest version of Autofixture, and I'd like to prevent it from filling automatically child collections. For example, I have a class Person that has a List property. I want all proper...
Rotor asked 31/7, 2013 at 18:56

1

Solved

How can I setup a deterministic test to verify that items in a list are ordered? First I did the following: public void SyncListContainsSortedItems( [Frozen] SyncItem[] expected, SyncItemList ...
Aerialist asked 25/7, 2013 at 19:55

1

Solved

Here's my object: public class Symbol { private readonly string _identifier; private readonly IList<Quote> _historicalQuotes; public Symbol(string identifier, IEnumerable<Quote> hi...
Wamsley asked 24/7, 2013 at 22:51

2

Solved

I am trying to get access to a mocked (via Nsubstitute) class that was injected onto the constructor. I was using the following code var fixture = new Fixture() .Customize(new AutoNSubstituteCus...
Polyptych asked 25/6, 2013 at 15:25

1

Solved

I am trying to create a customization that allows me to specify that the properties of types that are not in a certain namespace should not be populated. Basically, I am trying to change this: fi...
Outguess asked 24/6, 2013 at 16:58

1

Solved

I have just started using AutoFixture and have this semi-complex data structure that I would like to create some specimen for. In the tests I am working with I don't care too much about content of...
Swerve asked 13/6, 2013 at 13:3

1

Solved

Given the following test: [Theory] [PropertyData("GetValidInputForDb")] public void GivenValidInputShouldOutputCorrectResult( string patientId , string patientFirstName ) { var fixture = new Fi...
Budweis asked 30/5, 2013 at 16:29

2

Solved

I have previously asked a similar question on SO to which I got an answer. At the time, for the sake of expediency, I mechanically applied the answer but now I'm trying to get a handle on how the m...
Cannibalize asked 24/5, 2013 at 9:33

3

Solved

SO follow this example example and how make a fake DBContex For test my test using just this work fine [Test] public void CiudadIndex() { var ciudades = new FakeDbSet<Ciudad> { new Ciuda...
Eby asked 22/5, 2013 at 16:16

2

Solved

I need to create an object from AutoFixture using nothing more than a System.Type. However, there doesn't appear to be an overload of CreateAnonymous() that simply takes a type. They all expect a c...
Contravallation asked 14/5, 2013 at 15:12

1

Solved

When i set property with "with" method, its leave null all propertys on nested objects which same named. (im using autofixture's latest version as 3.0.8) public class Something { public string I...
E asked 6/5, 2013 at 7:15

1

Solved

I'm creating an AutoFixture specimen builder for a particular type, in this case System.Data.DataSet. The builder will return a FakeDataSet, which is a customized DataSet for testing. The followin...
Methacrylate asked 1/5, 2013 at 16:56

1

Solved

I am having trouble expressing the following code in a declarative fashion: [Theory] [InlineData(@"-o=C:\Temp\someFile -p=1")] [InlineData(@"-p=1 -o=C:\Temp\someFile")] public void ParseMissingPar...
Harman asked 22/4, 2013 at 10:50

2

Solved

Does this test make proper use of AutoFixture and Moq? Is it written as concisely as possible? The test fails, as expected, and passes after writing the correct implementation. [Fact] public void ...
Marino asked 4/3, 2013 at 18:52

3

Solved

I'm trying to overcome a scenario in which a class has a string constructor parameter which cannot be satisfied by any old string generated by Autofixture (the Guid-y looking value). Before you'r...
Sinclare asked 20/3, 2013 at 18:0

1

Solved

I'm trying to understand how to use the CreateProxy() feature of Likeness<T>() using two instances of a simple class. public class Band { public string Strings { get; set; } public strin...
Whipcord asked 18/3, 2013 at 6:38

3

Solved

Given this system to test: public class MySut { private readonly IHardToMockDependency _hardToMockDependency; public MySut(IHardToMockDependency hardToMockDependency, IOtherDependency otherD...
Poss asked 15/3, 2013 at 21:48

1

Solved

I use AutoFixture with AutoMoq. I try to create a fake instance of a class which has a property with a getter but without a setter. I expect AutoFixture to configure the mock so it will return the ...
Uneasy asked 11/3, 2013 at 12:40

1

Solved

The code: IFixture fixture = new Fixture().Customize(new AutoMoqCustomization()); fixture.Customize<ViewDataDictionary>(c => c.Without(x => x.ModelMetadata)); var target = fixture.Crea...
Caslon asked 20/2, 2013 at 17:17

1

Solved

I wrote the following customization and have it applied as part of a composite on most of my tests. My entities have a read-only Id, but I'm using their SetId method in this customization to make s...
Roma asked 1/2, 2013 at 2:59

1

Solved

I'm trying to write a suite of database integration tests for my domain which uses Entity Framework. I would prefer to autofixture objects in some scenarios. My ideal syntax would be something like...
Margarettemargarida asked 18/1, 2013 at 1:32

2

Solved

I love AutoFixture, but have run into a bit of very repetitive "arrange" code that I feel like it should be able to handle - somehow. Here is my scenario, illustrated using implementations of IInt...
Breadroot asked 19/12, 2012 at 20:33

1

Solved

In an attempt to DRY up my unit tests, I'm trying to use AutoFixture as an IoC container to instantiate my system under test (SUT), which in this particular case are ASP.NET MVC Controllers. Theref...
Deidradeidre asked 13/12, 2012 at 22:54

2

Solved

The short takeaway now that the solution has been found: AutoFixture returns frozen the mock just fine; my sut that was also generated by AutoFixture just had a public property with a local defaul...
Pouched asked 21/11, 2012 at 0:21

1

Solved

I'm really appreciating the power of AutoFixture coupled with XUnit's theories. I've recently adopted the use of encapsulating customizations and providing them to my tests via an attribute. On ce...
Bootleg asked 29/10, 2012 at 19:40

© 2022 - 2024 — McMap. All rights reserved.