public void Get_ShouldReturnValidInstance_ForSupportedTypes() { // Arrange. var configuration = new ConfigurationBuilder().Build(); using (var factory = new SimulatedInstrumentFactory(configuration)) { using (var target = new FactoryProducedInstanceGroup(factory)) { // Act. var result = target.Get <SimulatedInstrument>(); // Assert. result.Should().NotBeNull(); result.Should().BeOfType <SimulatedInstrument>(); } } }
public void Get_ShouldRaiseArgumentException_ForUnsupportedTypes() { // Arrange. var configuration = new ConfigurationBuilder().Build(); using (var factory = new SimulatedInstrumentFactory(configuration)) { using (var target = new FactoryProducedInstanceGroup(factory)) { // Act. var action = new Action(() => { target.Get <DateTimeRange>(); }); // Assert. action.Should().Throw <ArgumentException>(); } } }