public void CanBuildType_WithAbstractDependencies() { var sut = new BaseUnitTest <TypeWithAbstractDependcies>(); var built = sut.Build(); Assert.NotNull(sut.ClassUnderTest); }
public void CanBuildType_WithNoDependencies() { var sut = new BaseUnitTest <TestableTypeNoDependencies>(); var built = sut.Build(); Assert.NotNull(sut.ClassUnderTest); }
public void CanGet_TheMock() { var sut = new BaseUnitTest <TypeWithInterfaceDependencies>(); var mock = sut.Mock <IFooService>(); Assert.NotNull(mock); Assert.IsType <Mock <IFooService> >(mock); }
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 Instances_AreSingletons() { var sut = new BaseUnitTest <TypeWithInterfaceDependencies>(); var first = sut.Mock <IBarService>(); var second = sut.Mock <IBarService>(); Assert.Equal(first, 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); }
public void CanGetInstance() { var sut = new BaseUnitTest <TypeWithInterfaceDependencies>(); var bar = sut.Mock <IBarService>(); }
public void SystemUnderTest_AvailableUponInstantiation() { var sut = new BaseUnitTest <TypeWithInterfaceDependencies>(); Assert.NotNull(sut.ClassUnderTest); }