Beispiel #1
0
        public void GivenBusinessLogicBehaviourGenerator_WhenSingleNotSupportRegen_ThenSingleClassCreated()
        {
            var settings = Substitute.For <ISettings>();
            var module   = ModuleBuilders.CreateModule();

            var c = new BusinessLogicBehaviour.Generator(settings, module, module.Models.First());

            IFileGroup output = c.Create() as IFileGroup;

            Approvals.VerifyAll(output.Files, "file", f => $"{f.FullName}\r\n{f.Content}");
        }
Beispiel #2
0
        public void GivenDataAccessConfigGenerator_WhenSingleSupportRegen_ThenSingleClassCreated()
        {
            var settings = Substitute.For <ISettings>();

            settings.SupportRegen = true;
            var module = ModuleBuilders.CreateModule();

            var c = new EntityFrameworkClass.Generator(settings, module, module.Models.First());

            IFileGroup output = c.Create() as IFileGroup;

            Approvals.VerifyAll(output.Files, "file", f => $"{f.FullName}\r\n{f.Content}");
        }
Beispiel #3
0
        public void GivenBusinessLogicProjectGenerator_WhenGenerating_ThenProjectCreated()
        {
            var packageService = Substitute.For <IPackageService>();
            var settings       = Substitute.For <ISettings>();

            settings.SupportRegen.Returns(true);
            var packages = new Packages(packageService, settings);

            settings.Packages.Returns(packages);
            var module = ModuleBuilders.CreateProject();

            var c = new BusinessLogicProject.Generator(settings, module);

            IProject output = c.Create() as IProject;

            Approvals.VerifyAll(output.FileGroups.SelectMany(f => f.Files), "file", f => $"{f.FullName}\r\n{f.Content}");
        }