public void WhenBuilderIsFound__BuildMethodShouldBeInvoked() { var surfaceBuilderMock = new Mock <IPlateauBuilder>(); var sut = new SurfaceBuilderFactory(new List <ISurfaceBuilder> { surfaceBuilderMock.Object }); ISurfaceBuilder surfaceBuilder = sut.Generate(typeof(Plateau)); Assert.NotNull(surfaceBuilder); Assert.True(surfaceBuilder is IPlateauBuilder); }
public void WhenSurfaceBuilderCollectionDoesNotContainsAnyItem__DevelopmentExceptionOccurs() { var sut = new SurfaceBuilderFactory(new List <ISurfaceBuilder>()); Assert.Throws <DevelopmentException>(() => sut.Generate(typeof(Plateau))); }