Ejemplo n.º 1
0
        private static void Main()
        {
            var generator = SetUpGenerator();
            var logger    = SetUpLogger();

            VersionedDeserializers.RegisterFromAssembly(typeof(Program).Assembly);

            Application.Init();

            var commandProvider = new CommandsProvider(AppController.Instance(), logger);
            var menu            = new MenuWindow(commandProvider);

            AppController.Instance().StartWindow(menu, generator, logger);
        }
Ejemplo n.º 2
0
        public void Execute()
        {
            try
            {
                var path         = Path.Join(_file.ParentDirectory, _file.FileName);
                var openApiModel = VersionedDeserializers.Instance().DeserializeFile(path, _deserializationSettings);

                _onDeserialization(openApiModel);
            }
            catch (Exception e)
            {
                _onError(e);
            }
        }
        public void RegisterFromAssemblyTest()
        {
            // Arrange
            var assembly  = new Mock <Assembly>();
            var prevState = FakeDeserializer.Construction;

            assembly.Setup(x => x.GetTypes()).Returns(new[]
            {
                typeof(FakeDeserializer)
            });

            // Act
            VersionedDeserializers.RegisterFromAssembly(assembly.Object);

            // Assert
            assembly.Verify(x => x.GetTypes(), Times.Once);
            Assert.Equal(prevState + 1, FakeDeserializer.Construction);
        }