Esempio n. 1
0
        public void OutputFormatterConfiguration_ConfigureOutputFormatterWithInValidFormatNumbers(int formatNumber)
        {
            var fakeUnityContainer = new UnityContainer();

            var fakeMenu = new FakeMenu(formatNumber);

            var outputFormatterConfiguration = new OutputFormatterConfiguration(fakeUnityContainer, fakeMenu);

            Assert.Throws <NotImplementedException>(() => outputFormatterConfiguration.Configure());
        }
Esempio n. 2
0
        public void OutputFormatterConfiguration_ConstructorParametersNotNullReturnsOutputFormatterConfiguration()
        {
            var fakeUnityContainer = NSubstitute.Substitute.For <IUnityContainer>();

            var fakeMenu = NSubstitute.Substitute.For <IMenu>();

            var outputFormatterConfiguration = new OutputFormatterConfiguration(fakeUnityContainer, fakeMenu);

            Assert.NotNull(outputFormatterConfiguration);
        }
Esempio n. 3
0
        public void OutputFormatterConfiguration_ConfigureOutputFormatterWithValidFormatNumbers(int formatNumber)
        {
            var fakeUnityContainer = new UnityContainer();

            var fakeMenu = new FakeMenu(formatNumber);

            var outputFormatterConfiguration = new OutputFormatterConfiguration(fakeUnityContainer, fakeMenu);

            outputFormatterConfiguration.Configure();

            var numberOfRegistration = fakeUnityContainer.Registrations.Where(x => x.RegisteredType == typeof(IOutputFormatter)).Count();

            var expectedNumberOfRegistrations = 1;

            Assert.Equal(expectedNumberOfRegistrations, numberOfRegistration);
        }