protected override void Arrange()
            {
                var container = ContainerHelper.CreateContainer(new Options());

                _assemblyDataProvider = container.Resolve <IEnumerable <IAssemblyDataProvider> >()
                                        .Single(x => x is AssemblyDataProvider);
            }
Beispiel #2
0
            public void Should_throw_error()
            {
                _container = ContainerHelper.CreateContainer();

                // Arrange
                _templateWriterData = new TemplateWriterData
                {
                    Model = new
                    {
                        NamespaceName = namespaceName,
                        ClassName     = "testClass",
                        InterfaceName = "testInterfaceName"
                    },
                    TemplateSet = new TemplateSet {
                        Name = templateName
                    },
                    OutputPath = $"{Environment.CurrentDirectory}\\Output.cs"
                };

                // Act
                var exception = Assert.ThrowsAsync <KeyNotFoundException>(
                    async() => await _container.Resolve <ITemplateWriter>()
                    .WriteAsync(_templateWriterData, CancellationToken.None));

                // Assert
                exception.Message.ShouldMatch($"The given key '{templateName}' was not present in the dictionary.");
            }
        public ProfileTestDataHelper(string fileName)
        {
            var container = ContainerHelper.CreateContainer();

            _domainModel = new DomainModelProvider(
                container.Resolve <IDomainModelDefinitionsProviderProvider>()
                .DomainModelDefinitionProviders()
                .ToList()).GetDomainModel();

            Validator = GetValidator(fileName);
        }
            protected override void Arrange()
            {
                var container = ContainerHelper.CreateContainer(
                    new Options
                {
                    ExtensionPaths = new[]
                    {
                        new CodeRepositoryHelper(TestContext.CurrentContext.TestDirectory)[
                            CodeRepositoryConventions.ExtensionsRepositoryName]
                    }
                });

                _assemblyDataProviders = container.Resolve <IEnumerable <IAssemblyDataProvider> >();
            }
Beispiel #5
0
        public async Task CanAttachContainer()
        {
            var sut = new ContainerHelper();

            CreateContainerResponse createContainerResponse = await sut.CreateContainer(@"shawnseabrook/build:50", "canattach", new List <string> {
                "ListTests"
            });

            await sut.StartContainer(createContainerResponse.ID);

            string res = await sut.AttachContainer(createContainerResponse.ID);

            Console.WriteLine(res);
        }
Beispiel #6
0
            protected override void Arrange()
            {
                var container = ContainerHelper.CreateContainer(
                    new Options
                {
                    ExtensionPaths = new[]
                    {
                        new CodeRepositoryHelper(TestContext.CurrentContext.TestDirectory)[
                            CodeRepositoryConventions.ExtensionsRepositoryName]
                    }
                });

                _domainModelDefinitionProvidersProvider = container.Resolve <IDomainModelDefinitionsProviderProvider>();
            }
            public void Should_throw_error()
            {
                // Arrange
                _container = ContainerHelper.CreateContainer(new Options());

                // Act
                var exception =
                    Assert.Throws <ArgumentOutOfRangeException>(
                        () => _container.Resolve <ITemplateSetProvider>()
                        .GetTemplatesByName(templateSetName));

                // Assert
                exception.Message.ShouldMatch(nameof(templateSetName));
            }
Beispiel #8
0
 private static void CreateContainer(ContainerHelper containerHelper, string containerName)
 {
     if (!string.IsNullOrWhiteSpace(containerName))
     {
         if (containerHelper.ContainerExists(containerName))
         {
             Console.WriteLine("A container is already present with same name, see the full list of containers in the storage account");
             ListContainers(containerHelper);
         }
         else
         {
             containerHelper.CreateContainer(containerName).Wait();
         }
     }
     else
     {
         Console.WriteLine($"Name is required");
     }
 }
Beispiel #9
0
 protected override void Arrange() => _container = ContainerHelper.CreateContainer();
 protected override void Arrange() => _container = ContainerHelper.CreateContainer(new Options());
 protected override void Arrange()
 {
     _container            = ContainerHelper.CreateContainer();
     _assemblyDataProvider = _container.Resolve <IAssemblyDataProvider>();
 }