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; | |
namespace Oinant.Blog.Factory.SimpleExemple | |
{ | |
public class MyBusinessObject | |
{ | |
private string _content; | |
private DateTime _dateTimeReleventToBusinessLogic; | |
public MyBusinessObject(Tuple<DateTime, String> creationData) | |
{ |
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; | |
namespace ExternalLibrary | |
{ | |
public class NetworkMessage | |
{ | |
static readonly TimeSpan TimeToLive = TimeSpan.FromSeconds(10); | |
private readonly DateTime _creation; | |
private Status _status; |
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 ExternalLibrary; | |
namespace Oinant.Blog.Factory.ForTesting | |
{ | |
public class NetworkClientWithoutMessageFactory | |
{ | |
public string SendRequest() | |
{ | |
var message = new NetworkService().SendMessage(); |
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 ExternalLibrary; | |
namespace Oinant.Blog.Factory.ForTesting | |
{ | |
public class NetworkClientWithoutMessageFactory | |
{ | |
public string SendRequest() | |
{ | |
var message = new NetworkService().SendMessage(); |
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 ExternalLibrary; | |
namespace Oinant.Blog.Factory.ForTesting | |
{ | |
public class NetworkClientWithMessageFactory | |
{ | |
private readonly INetworkMessageFactory _networkMessageFactory; | |
public NetworkClientWithMessageFactory(INetworkMessageFactory networkMessageFactory) | |
{ |
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 ExternalLibrary; | |
using Oinant.Blog.Factory.ForTesting; | |
namespace Factory.Tests | |
{ | |
public class TestFactory : INetworkMessageFactory | |
{ | |
public NetworkMessage Create(Status status, object content) | |
{ | |
var message = new NetworkMessageDouble(status, content); |