示例#1
0
        public void Produce_ShouldReturnNewObjectOfSpecifiedType_ForSupportedType()
        {
            // Arrange.
            var configuration = new ConfigurationBuilder().Build();

            using (var target = new SimulatedInstrumentFactory(configuration))
            {
                // Act.
                var result = target.Produce <CircularBuffer <Int32> >();

                // Assert.
                result.Should().NotBeNull();
                result.Should().BeOfType <CircularBuffer <Int32> >();
            }
        }
示例#2
0
        public void Produce_ShouldRaiseArgumentException_ForUnsupportedType()
        {
            // Arrange.
            var configuration = new ConfigurationBuilder().Build();

            using (var target = new SimulatedInstrumentFactory(configuration))
            {
                // Act.
                var action = new Action(() =>
                {
                    target.Produce <ReferenceManager>();
                });

                // Assert.
                action.Should().Throw <ArgumentException>();
            }
        }