public static CreateSolution AddCSharpSolution(this List<ICommand> command, string path, string name) { CreateSolution solution = new CreateSolution(new CreateSolutionParam { Path = path, SolutionName = name }); command.Add(solution); return solution; }
public void CreateSolution_SupportedType_IsProject() { var writer = Substitute.For <IFileWriter>(); var sut = new CreateSolution(writer); sut.SupportedType.Should().Be <ISolution>(); }
public void GivenThatASupplierHasProvidedAllMandatoryDataOnTheMarketingPage() { SqlHelper.UpdateSolutionDetails(CreateSolution.CreateCompleteSolutionDetail(_test.solution, _test.solutionDetail), _test.connectionString); _test.driver.Navigate().Refresh(); _test.pages.Dashboard.NavigateToSection("Solution description"); _test.pages.SolutionDescription.SummaryAddText(100); _test.pages.SolutionDescription.SaveAndReturn(); }
public void CreateSolution_Create_ThrowsWithSnippet() { var writer = Substitute.For <IFileWriter>(); var output = Substitute.For <IFile>(); var sut = new CreateSolution(writer); var act = () => sut.Create(output); act.Should().Throw <NotSupportedException>(); }
public UITest() { solution = CreateSolution.CreateNewSolution(); solutionDetail = CreateSolutionDetails.CreateNewSolutionDetail(solution.Id, Guid.NewGuid(), 0, false); connectionString = EnvironmentVariables.GetConnectionString(); SqlHelper.CreateBlankSolution(solution, solutionDetail, connectionString); url = $"{EnvironmentVariables.GetUrl()}/{solution.Id}"; driver = new BrowserFactory().Driver; pages = new PageActions(driver).PageActionCollection; driver.Navigate().GoToUrl(url); }
public void create_a_new_solution() { var context = TemplatePlan.CreateClean("create-solution"); var step = new CreateSolution("MySolution"); context.Add(step); context.Execute(); var file = context.Root.AppendPath("src", "MySolution.sln"); File.Exists(file).ShouldBeTrue(); var solution = Solution.LoadFrom(file); solution.ShouldNotBeNull(); // really just a smoke test that we can parse it back out }
public void CreateSolution_Create_WritesFIle() { var writer = Substitute.For <IFileWriter>(); var output = Substitute.For <ISolution>(); var project = Substitute.For <IProject>(); var fileGroup = Substitute.For <IFileGroup>(); var file = Substitute.For <IFile>(); output.Projects.Returns(new [] { project }); output.Files.Returns(new [] { file }); project.FileGroups.Returns(new [] { fileGroup }); fileGroup.Files.Returns(new [] { file }); var sut = new CreateSolution(writer); sut.Create(output); writer.ReceivedCalls().Should().HaveCount(2); }
public void Builder_Real_Test() { var config = new GeneratorConfiguration { GeneratorName = "NetCore3Solution", LocalFolder = "F:\\Repos\\Modeller.SampleGenerators\\src\\Generators", Target = "net5.0", OutputPath = "f:\\dev\\test\\members", SourceModel = "f:\\repos\\modeller.samplegenerators\\src\\members_model.json" }; var logger = new Mock <ILogger <IPackageService> >(); var loggerContext = new Mock <ILogger <IContext> >(); var settingLoader = new JsonSettingsLoader(); var moduleLoader = new JsonModuleLoader(); var generatorLoader = new GeneratorLoader(); var packageLoader = new PackageFileLoader(); var packageService = new PackageService(packageLoader, logger.Object); var context = new Context(settingLoader, moduleLoader, generatorLoader, packageService, loggerContext.Object); var loggerCG = new Mock <ILogger <ICodeGenerator> >(); var loggerFW = new Mock <ILogger <FileWriter> >(); var loggerB = new Mock <ILogger <IBuilder> >(); var codeGenerator = new CodeGenerator(loggerCG.Object); var fileWriter = new FileWriter(loggerFW.Object); var fc1 = new CreateFile(fileWriter); var fc2 = new CreateFileGroup(fileWriter); var fc3 = new CreateProject(fileWriter); var fc4 = new CreateSnippet(fileWriter); var fc5 = new CreateSolution(fileWriter); var list = new List <IFileCreator> { fc1, fc2, fc3, fc4, fc5 }; var outputStrategy = new OutputStrategy(list); var builder = new Builder(context, codeGenerator, outputStrategy, loggerB.Object); builder.Create(config); }
public async Task <StatusViewModel> PostSolutionAsync([FromBody] CreateSolution createSolution) { var id = await _mediator.Send(createSolution); return(new CreationStatusViewModel(id)); }
/// <summary> /// Initializes a new instance of the <see cref="CreateSolutionTests"/> class. /// </summary> public CreateSolutionTests() { this.solutionServiceMock = new Mock <ISolutionService>(); this.codeActivity = new CreateSolution(this.solutionServiceMock.Object); }
private void CreateBusinessProjects(CreateSolution solution) { CreateProject businessConcrete = solution .AddCSharpProject("Business.Concrete") .AddCSharpProjectJson(ProjectJson.BusinessConcrete); CreateProject businessContract = solution .AddCSharpProject("Business.Contract") .AddCSharpProjectJson(ProjectJson.BusinessContract); CreateProject businessEntity = solution .AddCSharpProject("Business.Entity") .AddCSharpProjectJson(ProjectJson.BusinessEntity); businessEntity .AddFile("", "TempClass.cs", Resources.CSharp.TempClass); CreateProject businessData = solution .AddCSharpProject("Business.Data") .AddCSharpProjectJson(ProjectJson.BusinessData); CreateProject businessFactory = solution .AddCSharpProject("Business.Factory") .AddCSharpProjectJson(ProjectJson.BusinessFactory) .AddCSharpFactoryDo(); CreateProject businessResource = solution .AddCSharpProject("Business.Resource") .AddCSharpProjectJson(ProjectJson.BusinessResource); CreateProject businessTest = solution .AddCSharpProject("Business.Test") .AddCSharpProjectJson(ProjectJson.BusinessTest); businessTest .AddFile("", "appsettings.json", Resources.CSharp.AppSettingsTest) .AddFile("", "BaseTest.cs", Resources.CSharp.TestBase) .AddFile(".DataScenery", "SceneryType.cs", Resources.CSharp.TestSceneryType) .AddFile(".DataScenery", "SceneryManager.cs", Resources.CSharp.TestSceneryManager) .AddFile(".DataScenery", "Contants.cs", Resources.CSharp.TestContants) .AddFile(".DataScenery\\Sceneries", "CleanDataBaseScenery.cs", Resources.CSharp.TestCleanDataBaseScenery); CreateProject businessGenerator = solution .AddCSharpProject("CodeGenerator") .AddCSharpProjectJson(ProjectJson.BusinessCodeGenerator); businessGenerator .AddFile(".", "Program.cs", Resources.CSharp.GeneratorProgram); }