Created
March 21, 2016 00:32
-
-
Save AlphaGit/0a9f0fcfc2a947e8a481 to your computer and use it in GitHub Desktop.
Coupled consumer Fakes Aseembly tests
This file contains hidden or 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 ClassDependencyTest.Example.Coupled; | |
using ClassDependencyTest.Example.Coupled.Fakes; | |
using Microsoft.QualityTools.Testing.Fakes; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace ClassDependencyTestTests.Example.Coupled | |
{ | |
[TestClass] | |
public class ConsumerTests | |
{ | |
[TestMethod] | |
public void DoConsumptionTest() | |
{ | |
using (ShimsContext.Create()) | |
{ | |
ShimProducer.AllInstances.DoProduction = _self => new object(); | |
var consumer = new Consumer(); | |
Assert.IsTrue(consumer.DoConsumption()); | |
} | |
} | |
[TestMethod] | |
public void DoConsumptionTest_OnNull() | |
{ | |
using (ShimsContext.Create()) | |
{ | |
ShimProducer.AllInstances.DoProduction = _self => null; | |
var consumer = new Consumer(); | |
Assert.IsFalse(consumer.DoConsumption()); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment