This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ContactEditTests | |
{ | |
... | |
public void ShouldSaveChangesToSelectedContact(Contact contactToEdit, Contact anotherContact) | |
{ | |
Save(contactToEdit, anotherContact); | |
var selectedContactId = contactToEdit.Id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ContactEditTests | |
{ | |
... | |
public void ShouldRequireMinimumFields() | |
{ | |
new ContactEdit.Command() | |
.ShouldNotValidate("'Name' should not be empty."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ContactList.Tests.Features | |
{ | |
using Core.Domain; | |
using ContactList.Features.Contact; | |
using static Testing; | |
using Should; | |
public class ContactEditTests | |
{ | |
public void ShouldDisplaySelectedContact(Contact contactToEdit, Contact anotherContact) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ContactList.Features.Contact | |
{ | |
using System.Web.Mvc; | |
using MediatR; | |
public class ContactController : Controller | |
{ | |
private readonly IMediator _mediator; | |
public ContactController(IMediator mediator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using MediatR; | |
using Should; | |
using static Testing; | |
public static class Assertions | |
{ | |
public static void ShouldValidate<TResponse>(this IRequest<TResponse> message) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TestDependencyScope | |
{ | |
private static IContainer _currentNestedContainer; | |
public static void Begin() | |
{ | |
if (_currentNestedContainer != null) | |
throw new Exception("Cannot begin test dependency scope. Another dependency scope is still in effect."); | |
_currentNestedContainer = IoC.Container.GetNestedContainer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AutoMapperTests | |
{ | |
public void ShouldHaveValidConfiguration() | |
{ | |
Mapper.AssertConfigurationIsValid(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '{build} ({branch})' | |
skip_tags: true | |
init: | |
- cmd: git config --global core.autocrlf true | |
build_script: | |
- cmd: build | |
test: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Summary description for Class1. | |
/// </summary> | |
class Class1 | |
{ | |
/// <summary> | |
/// The main entry point for the application. | |
/// </summary> | |
[STAThread] | |
public static int Main(string[] args)... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var instance = new Thing(); | |
var method = typeof(Thing).GetMethod("GenericMethod"); | |
var methodOfInt32 = method.MakeGenericMethod(typeof(int)); | |
methodOfInt32.Invoke(instance, new object[] { 1 }); | |
var methodOfBoolean = method.MakeGenericMethod(typeof(bool)); | |
methodOfBoolean.Invoke(instance, new object[] { true }); |