public void CanBuildType_WithNoDependencies() { var sut = new BaseUnitTest <TestableTypeNoDependencies>(); var built = sut.Build(); Assert.NotNull(sut.ClassUnderTest); }
public void CanBuildType_WithAbstractDependencies() { var sut = new BaseUnitTest <TypeWithAbstractDependcies>(); var built = sut.Build(); Assert.NotNull(sut.ClassUnderTest); }
public void Instances_AreSameAsSystemUnderTest() { var sut = new BaseUnitTest <TypeWithInterfaceDependencies>(); var first = sut.Mock <IFooService>(); var second = sut.Build().FooService; Assert.Equal(first.Object, second); }
public void CanSetup_TheMock() { var sut = new BaseUnitTest <TypeWithInterfaceDependencies>(); var testObject = sut.Build(); var initial = testObject.FooService.Name(); var mock = sut.Mock <IFooService>(); var expected = "hello"; mock.Setup(foo => foo.Name()).Returns(expected); var result = testObject.FooService.Name(); Assert.NotEqual(expected, initial); Assert.Equal(expected, result); }