Skip to content

Instantly share code, notes, and snippets.

@plioi
Created January 26, 2016 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plioi/b15b1a6df8d7c5c0cf51 to your computer and use it in GitHub Desktop.
Save plioi/b15b1a6df8d7c5c0cf51 to your computer and use it in GitHub Desktop.
namespace ContactList.Core.Domain
{
using System;
public abstract class Entity
{
public Guid Id { get; set; }
}
public class Contact : Entity
{
public string Name { get; set; }
public string Email { get; set; }
public string Phone { get; set; }
}
}
@patrickbadley
Copy link

Hi Patrick! I'm following along your blog on powerful integration testing, and was wondering if you have the whole solution posted somewhere? Also if your strategy has changed much since the writing of that article? Thank you for the post, very interesting read and use of some interesting tools.

@plioi
Copy link
Author

plioi commented Oct 7, 2019 via email

@patrickbadley
Copy link

patrickbadley commented Oct 7, 2019 via email

@plioi
Copy link
Author

plioi commented Oct 9, 2019

See https://github.com/fixie/fixie.demo

Keep an eye out for README content comming soon, where I'll point out the highlights.

@patrickbadley
Copy link

patrickbadley commented Oct 9, 2019 via email

@patrickbadley
Copy link

patrickbadley commented Oct 30, 2019 via email

@plioi
Copy link
Author

plioi commented Oct 30, 2019

I generally avoid ReSpawn now. I'd rather force myself to write my tests a little more "defensively" so that I have more confidence that the features will really work against an interesting production database. If I'm testing something like a report query, though, I might have to start the test by deleting one or two tables myself, but I haven't run into that much.

Similarly, I've come to avoid AutoFixture. It's such a time saver at first, but in combination with things like Entity Framework, it results in very unrealistic entities being saved and interacted with. I'd rather take the extra time up front to set things up so that my test database experiences more realistic setup. That "Testing" file tends to grow to have helpers for performing the most common setup tasks. Those helpers will, themselves, Send(...) some message to be handled like Send(new RegisterUser.Command{...}) or Send(new AddContact.Command{...}) and yes, I fill in the properties myself "the hard way" :). If that gets boring, I usually have a small helper or two for including a randomized suffix on a string, or a realistic-looking random phone number, or whatever I really need in the moment. In all of this test setup helper method work, my decisions are specific to the application and emphasize brevity in the tests.

@patrickbadley
Copy link

Makes sense! I'll start with this and see what makes sense for us. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment