public void GetProviderOptions_can_leave_a_nullable_integer_unset(ICreatesWebDriverFromOptions factory,
                                                                          FactoryOptionsFactory sut,
                                                                          [NoAutoProperties] SampleOptionsType expectedResult)
        {
            // Arrange
            Mock.Get(factory)
            .Setup(x => x.CreateEmptyOptions())
            .Returns(expectedResult);
            var options = new Dictionary <string, string>();

            // Act
            var result = (SampleOptionsType)sut.GetFactoryOptions(factory, options);

            // Assert
            Assert.That(result.ANullableIntegerProperty, Is.Null);
        }
        public void GetProviderOptions_returns_created_instance_from_factory(ICreatesWebDriverFromOptions factory,
                                                                             FactoryOptionsFactory sut,
                                                                             SampleOptionsType expectedResult)
        {
            // Arrange
            Mock.Get(factory)
            .Setup(x => x.CreateEmptyOptions())
            .Returns(expectedResult);
            var options = new Dictionary <string, string>();

            // Act
            var result = sut.GetFactoryOptions(factory, options);

            // Assert
            Assert.That(result, Is.SameAs(expectedResult));
        }
        public void GetProviderOptions_can_set_a_nullable_integer(ICreatesWebDriverFromOptions factory,
                                                                  FactoryOptionsFactory sut,
                                                                  [NoAutoProperties] SampleOptionsType expectedResult,
                                                                  int expectedValue)
        {
            // Arrange
            Mock.Get(factory)
            .Setup(x => x.CreateEmptyOptions())
            .Returns(expectedResult);
            var options = new Dictionary <string, string> {
                { nameof(SampleOptionsType.ANullableIntegerProperty), expectedValue.ToString() },
            };

            // Act
            var result = (SampleOptionsType)sut.GetFactoryOptions(factory, options);

            // Assert
            Assert.That(result.ANullableIntegerProperty, Is.EqualTo(expectedValue));
        }