public void Add_Does_Not_Accept_Null() { var servicesMock = new Mock <IServiceCollection>().Object; var providerMock = new Mock <IServiceProvider>().Object; var containerMock = new DIContainer(servicesMock, providerMock); var error = Assert.Throws <ArgumentNullException>(() => containerMock.Add(null)); Assert.Equal("serviceType", error.ParamName); }