Example #1
0
 public DogService(IFileUtil fileUtil, IDogRepository dogRepository, IOptions <PaginationOption> paginationOption, IOptions <PathOption> pathOption)
 {
     this.fileUtil         = fileUtil;
     this.pathOption       = pathOption.Value;
     this.dogRepository    = dogRepository;
     this.paginationOption = paginationOption.Value;
 }
Example #2
0
 public ArchiveCryptManager()
 {
     path               = PathOption.GetInstance();
     encryptor          = new EncryptionOption();
     compressor         = new CompressionOption();
     compressAndEncrypt = new CompressAndEncryptOption();
 }
Example #3
0
 public static PathOption GetInstance()
 {
     if (instance == null)
     {
         instance = new PathOption();
     }
     return(instance);
 }
Example #4
0
        /// <summary>
        /// This method will retrieve a path option from all the configurations, ensuring it has the same value.
        /// If none of the configurations have the option, it will return the fallback value
        /// </summary>
        /// <typeparam name="T">The type of the option to lookup in the configurations.</typeparam>
        /// <param name="configurations">The list of configurations to look into.</param>
        /// <param name="fallback">Optional: Fallback value to return in case none of the configurations have the option.</param>
        /// <param name="rootpath">Optional: The rootpath to convert the path relative to.</param>
        /// <returns></returns>
        public static string GetConfOption <T>(IEnumerable <Project.Configuration> configurations, string fallback = RemoveLineTag, string rootpath = null)
            where T : PathOption
        {
            var values = configurations.Select(conf => PathOption.Get <T>(conf, fallback, rootpath)).Distinct().ToList();

            if (values.Count != 1)
            {
                throw new Error(nameof(T) + " has conflicting values in the configurations, they must all have the same");
            }

            return(values.First());
        }
Example #5
0
        internal void PathOption_DefaultValue_CreationTest(PathOption option, string expected)
        {
            //arange
            var cmd = new CommandLineApplication();

            option.AddTo(cmd);

            //act
            option.Validate();
            var actual = option.GetValue();

            //assert
            Assert.Equal(expected, actual);
        }
Example #6
0
        public static Command Create(Delegate executor = null)
        {
            var cmd = new Command("update", "Download and update local database.");

            cmd.AddAlias("force");

            cmd.Handler = CommandHandler.Create(executor ?? new Action <DataSource, string, string, string>(Execute));

            cmd.AddOption(ProviderOption.Create());
            cmd.AddOption(RepoOption.Create());
            cmd.AddOption(PathOption.Create());

            return(cmd);
        }
Example #7
0
        internal void PathOption_CustomValue_CreationTest(PathOption option, string argument, string expected)
        {
            //arange
            var cmd = new CommandLineApplication();

            option.AddTo(cmd);
            cmd.Options[0].Values.Add(argument);

            //act
            option.Validate();
            var actual = option.GetValue();

            //assert
            Assert.Equal(expected, actual);
        }
Example #8
0
        private AuthUtil CreateAuthUtil(IConfiguration configuration)
        {
            var pathOption = new PathOption();

            configuration.GetSection("Path").Bind(pathOption);

            var fsOption = new FileSystemOption();

            configuration.GetSection("FileSystem").Bind(fsOption);

            var fsService = new FileSystemService(fsOption, pathOption, null, null);
            var fs        = fsService.GetFileSystem(_coreOption.AuthFileSystem);

            return(new AuthUtil(fs));
        }
Example #9
0
        public DiaryServiceTest()
        {
            var pathOption = new PathOption
            {
                Default = new Dictionary <PathType, string>
                {
                    [PathType.DiaryNameListFile]     = "/db/diary/diary-name-list.json",
                    [PathType.DiaryListPath]         = "/db/diary/diary-info",
                    [PathType.DiaryContentsRootPath] = "/diary",
                },
            };

            var fsOption = new FileSystemOption
            {
                MainFileSystem = new MainFileSystemOption
                {
                    UseBackup      = false,
                    MainFileSystem = FileSystemType.InMemory,
                },
            };

            var diaryOption = new DiaryOption
            {
                FileSystemSelect = new FileSystemSelectOption
                {
                    UseMainFileSystem = true,
                },
            };

            var fileSystemService = new FileSystemService(fsOption, pathOption, null, null);

            _diaryService = new DiaryService(diaryOption, null, fileSystemService);

            _user = new AppUser("Test", "1234")
            {
                Email    = "*****@*****.**",
                UserName = "******",
            };
            _diary = new DiaryInfo
            {
                DiaryName = "testdiary",
                Id        = _user.Id,
                IsSecret  = false,
                Owner     = _user.Email,
                Writers   = new List <string>(),
                Viewers   = new List <string>(),
            };
        }
Example #10
0
        public static string NewDirectoryStructure(PathOption option)
        {
            string directoryStructure = "==========================" + Environment.NewLine +
                                        "EXPORT PATH //////////////////////" + Environment.NewLine +
                                        "==========================" + Environment.NewLine;
            string indent      = "";
            string driveMarker = ">";
            var    firstLetter = option.FullPath.Substring(0, 1);
            var    modPath     = option.FullPath.Substring(1, option.FullPath.Length - 1);
            var    folderList  = modPath.Split('\\').ToList();

            if (folderList[0] == ":")
            {
                folderList[0] = firstLetter;
            }
            foreach (var folder in folderList)
            {
                directoryStructure += indent + driveMarker + ">" + folder + Environment.NewLine;
                indent             += "  ";
                driveMarker         = "";
            }

            return(directoryStructure);
        }
Example #11
0
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddSingleton(_coreOption);

            #region Authentication

            var authUtil = CreateAuthUtil(Configuration);

            var googleAuthOption = authUtil.GetAuthOption(AuthProvider.Google);
            var kakaoAuthOption  = authUtil.GetAuthOption(AuthProvider.KakaoTalk);

            services.AddIdentityCore <AppUser>()
            .AddUserManager <AppUserManager <AppUser> >()
            .AddSignInManager <SignInManager <AppUser> >()
            .AddRoles <IdentityRole>()
            .AddRoleStore <RoleStore>();

            services.AddSingleton <IUserStore <AppUser>, UserStore>();

            services
            .AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
            .AddCookie();

            services
            //.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
            //.AddCookie()
            .AddAuthentication(options =>
            {
                options.DefaultAuthenticateScheme = IdentityConstants.ApplicationScheme;
                options.DefaultChallengeScheme    = IdentityConstants.ApplicationScheme;
                options.DefaultSignInScheme       = IdentityConstants.ExternalScheme;
                options.DefaultSignOutScheme      = IdentityConstants.ApplicationScheme;
            })
            .AddCookie(IdentityConstants.ExternalScheme)
            .AddCookie(IdentityConstants.ApplicationScheme)
            .AddGoogle(options =>
            {
                options.ClientId     = googleAuthOption?.ClientId;
                options.ClientSecret = googleAuthOption?.ClientSecret;
                options.CallbackPath = googleAuthOption?.Callback;
                options.ClaimActions.MapJsonKey("urn:google:profile", "link");
                options.ClaimActions.MapJsonKey("urn:google:image", "picture");
            })
            .AddKakaoTalk(options =>
            {
                options.ClientId     = kakaoAuthOption?.ClientId;
                options.ClientSecret = kakaoAuthOption?.ClientSecret;
                options.CallbackPath = kakaoAuthOption?.Callback;
            });

            services.AddAuthorization(options =>
            {
                options.FallbackPolicy = new AuthorizationPolicyBuilder()
                                         .RequireAuthenticatedUser()
                                         .Build();
            });

            services.AddHelloJkwPolicy();

            #endregion

            #region ASP.NET

            services.AddHttpContextAccessor();
            services.AddScoped <HttpContextAccessor>();
            services.AddHttpClient();
            services.AddScoped <HttpClient>();

            services.AddSingleton(Configuration);

            services.AddRazorPages();
            services.AddServerSideBlazor();

            //services.AddHostedService<TimedHostedService>();
            services.AddHostedService <QueuedHostedService>();
            services.AddSingleton <IBackgroundTaskQueue, BackgroundTaskQueue>();

            #endregion

            #region FileSystem

            var pathOption = new PathOption();
            Configuration.GetSection("Path").Bind(pathOption);
            services.AddSingleton(pathOption);

            var fsOption = new FileSystemOption();
            Configuration.GetSection("FileSystem").Bind(fsOption);
            services.AddSingleton(fsOption);

            services.AddSingleton <IFileSystemService, FileSystemService>();

            #endregion

            services.AddScoped <Radzen.DialogService>();
            services.AddDiaryService(Configuration);
            services.AddSuFcService(Configuration);
        }
Example #12
0
 public void EscapedSpaceInPath()
 {
     Expect(@"cat\ dog", PathOption.NewNamed(@"cat dog"));
 }
Example #13
0
 public void EscapedCommaInPath()
 {
     Expect(@"cat\,dog", PathOption.NewNamed(@"cat,dog"));
 }
Example #14
0
 public void SimpleListWithSpace()
 {
     Expect("foo bar", PathOption.NewNamed("foo"), PathOption.NewNamed("bar"));
 }
Example #15
0
 public void SimpleList()
 {
     Expect("foo,bar", PathOption.NewNamed("foo"), PathOption.NewNamed("bar"));
 }
Example #16
0
 public EncryptionOption()
 {
     path = PathOption.GetInstance();
 }
Example #17
0
 public CompressionOption()
 {
     path = PathOption.GetInstance();
 }
Example #18
0
 public CompressAndEncryptOption()
 {
     path = PathOption.GetInstance();
 }
Example #19
0
 public void Simple()
 {
     Expect("foo", PathOption.NewNamed("foo"));
 }
Example #20
0
        public async static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ApplicationDbContext(serviceProvider.GetRequiredService <DbContextOptions <ApplicationDbContext> >()))
            {
                var roleStore = new RoleStore <IdentityRole>(context);
                var userstore = new UserStore <User>(context);

                if (!context.Roles.Any(r => r.Name == "Administrator"))
                {
                    var role = new IdentityRole {
                        Name = "Administrator", NormalizedName = "Administrator"
                    };
                    await roleStore.CreateAsync(role);
                }

                if (!context.User.Any(u => u.Email == "*****@*****.**"))
                {
                    //  This method will be called after migrating to the latest version.
                    User user = new User
                    {
                        UserName           = "******",
                        NormalizedUserName = "******",
                        Email           = "*****@*****.**",
                        NormalizedEmail = "*****@*****.**",
                        EmailConfirmed  = true,
                        LockoutEnabled  = false,
                        SecurityStamp   = Guid.NewGuid().ToString("D")
                    };
                    var passwordHash = new PasswordHasher <User>();
                    user.PasswordHash = passwordHash.HashPassword(user, "Admin8*");
                    await userstore.CreateAsync(user);

                    await userstore.AddToRoleAsync(user, "Administrator");
                }

                // Look for any unitClasses.
                if (context.UnitClass.Any())
                {
                    return;   // DB has been seeded
                }

                var unitClass = new UnitClass[]
                {
                    new UnitClass {
                        Name = "Basic",

                        AbilityOneName        = "Punch",
                        AbilityOneDescription = "Lash out with your fists and smack the shit out of the enemy!",
                        AbilityOneDamage      = 15,

                        AbilityTwoName        = "Slap of Death",
                        AbilityTwoDescription = "Slap the life right out of the enemy!",
                        AbilityTwoDamage      = 50,
                        HpModifier            = 1
                    },
                };

                foreach (UnitClass u in unitClass)
                {
                    context.UnitClass.Add(u);
                }
                context.SaveChanges();

                var characters = new Character[]
                {
                    new Character {
                        Name        = "Mordran",
                        UnitClassId = unitClass.Single(u => u.Name == "Basic").Id,
                        HP          = 100,
                        User        = context.User.Single(user => user.Email == "*****@*****.**")
                    },
                };

                foreach (Character c in characters)
                {
                    context.Character.Add(c);
                }
                context.SaveChanges();


                var enemy = new Enemy[]
                {
                    new Enemy {
                        Name        = "Zombie",
                        UnitClassId = unitClass.Single(u => u.Name == "Basic").Id,
                        HP          = 100,
                        Boss        = false
                    },
                    new Enemy {
                        Name        = "Lich",
                        UnitClassId = unitClass.Single(u => u.Name == "Basic").Id,
                        HP          = 75,
                        Boss        = false
                    },
                    new Enemy {
                        Name        = "Balrog",
                        UnitClassId = unitClass.Single(u => u.Name == "Basic").Id,
                        HP          = 200,
                        Boss        = true
                    }
                };

                foreach (Enemy e in enemy)
                {
                    context.Enemy.Add(e);
                }
                context.SaveChanges();

                var adventure = new Adventure[]
                {
                    new Adventure {
                        Title = "The Epic One"
                    },
                };

                foreach (Adventure a in adventure)
                {
                    context.Adventure.Add(a);
                }
                context.SaveChanges();

                var roadBlock1 = new RoadBlock();
                roadBlock1.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                roadBlock1.StartingPoint    = true;
                roadBlock1.Description      = "You are a loyal member of the Kings Army.  One evening, while on patrol, a woman rushes up to you and says 'It took my necklace!!  That THING took the necklace that's been in my family for generations!' You look past her to see a large creature skulking into the woods nearby.";
                roadBlock1.PreviousOptionId = null;

                context.RoadBlock.Add(roadBlock1);
                context.SaveChanges();

                var options1 = new PathOption[]
                {
                    new PathOption
                    {
                        Description   = "Rush into the woods after the creature!",
                        LeadsToCombat = false
                    },
                    new PathOption
                    {
                        Description   = "Keep on walking, this isn't any of your concern.",
                        LeadsToCombat = true
                    }
                };

                foreach (PathOption p in options1)
                {
                    context.PathOption.Add(p);

                    StoryPath path = new StoryPath();

                    path.RoadBlockId  = roadBlock1.Id;
                    path.PathOptionId = p.Id;

                    context.StoryPath.Add(path);
                }
                context.SaveChanges();

                var roadBlock2_1 = new RoadBlock();
                roadBlock2_1.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                roadBlock2_1.Description      = "As you enter the woods the world goes black.  The forrest is so dark you cannot see.  You hear nothing but the wind rushing through the branches.";
                roadBlock2_1.PreviousOptionId = options1.Single(p => p.Description == "Rush into the woods after the creature!").Id;
                roadBlock2_1.StartingPoint    = false;

                context.RoadBlock.Add(roadBlock2_1);
                context.SaveChanges();

                var options2_1 = new PathOption[]
                {
                    new PathOption
                    {
                        Description   = "Feel around in the darkness for something to make a torch.",
                        LeadsToCombat = false
                    },

                    new PathOption
                    {
                        Description   = "Rush ahead blindly, the creature is getting away!",
                        LeadsToCombat = true
                    }
                };

                foreach (PathOption p in options2_1)
                {
                    context.PathOption.Add(p);

                    StoryPath path = new StoryPath();

                    path.RoadBlockId  = roadBlock2_1.Id;
                    path.PathOptionId = p.Id;

                    context.StoryPath.Add(path);
                }
                context.SaveChanges();

                RoadBlock Woods_1 = new RoadBlock();
                Woods_1.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                Woods_1.Description      = "You feel desparately on the ground for anything that will burn.  You find a dry branch, tear the sleae of your tunic off and wrap the top of the branch with it.  You use flint to spark the cloth alight.  You press on into the forrest.  You come to a clearing blanketed in low hanging fog.  The air feels cold, and across the clearing you see the necklace lying on the stump of a tree.  You rush forward but stop short as a figure glides around from the forrest edge towards the necklace.  The figure is floating half a foot off the ground and is cloaked in a black decrepit looking robe embroidered with glittering runes.  Its skin is pale and you can see spots where the flesh is decaying.  You recognize the creature as a Lich, an undead sorceror.  The Lich doesn't appear to have noticed your presence.  It turns towards the necklace and green magic shoots from its fingers!  The necklace rises from the stump.  The lich is transfering its essence into the neckalce to create a phylactory!  If it succeeds it will become immortal and torment the nearby village!";
                Woods_1.PreviousOptionId = options2_1.Single(o => o.Description == "Feel around in the darkness for something to make a torch.").Id;
                Woods_1.StartingPoint    = false;

                context.RoadBlock.Add(Woods_1);
                context.SaveChanges();

                RoadBlock Woods_2 = new RoadBlock();
                Woods_2.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                Woods_2.Description      = "You run with your arms splayed in front of you feeling for any trees that might be in your way.  Brush snags at your trousers.  You feel wiry twigs claw at your face.  Suddenly the ground beneath your feet disapears.  You fall off the edge of a cliff and plummett to your death.";
                Woods_2.GameOver         = true;
                Woods_2.PreviousOptionId = options2_1.Single(o => o.Description == "Rush ahead blindly, the creature is getting away!").Id;
                Woods_2.StartingPoint    = false;

                context.RoadBlock.Add(Woods_2);
                context.SaveChanges();

                var optionsWood_1 = new PathOption[]
                {
                    new PathOption()
                    {
                        Description   = "Draw your weapon and prepare for battle!  This creature cannot be allowed to terrorize your people!",
                        LeadsToCombat = true
                    },
                    new PathOption()
                    {
                        Description   = "The creature fills you with terror and you turn and run back towards the woods to try and escape!",
                        LeadsToCombat = false
                    }
                };

                foreach (PathOption o in optionsWood_1)
                {
                    context.PathOption.Add(o);

                    StoryPath path = new StoryPath();
                    path.PathOptionId = o.Id;
                    path.RoadBlockId  = Woods_1.Id;

                    context.StoryPath.Add(path);
                }

                context.SaveChanges();

                RoadBlock Woods_1_2 = new RoadBlock();
                Woods_1_2.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                Woods_1_2.Description      = "The Lich hears you rushing away!  The air around you glows green and you feel your body leave the ground.  You are pulled back with such force that the air is knocked out of your lungs!  The Lich is in front of you now, its eyes glowing a sinister blue.  It raises a hand and lighting crackles from its fingertips.  Your body is wracked with pain and you all to the ground in a heap!";
                Woods_1_2.PreviousOptionId = optionsWood_1.Single(o => o.Description == "The creature fills you with terror and you turn and run back towards the woods to try and escape!").Id;
                Woods_1_2.StartingPoint    = false;

                context.RoadBlock.Add(Woods_1_2);
                context.SaveChanges();

                PathOption Woods_1_2options = new PathOption();
                Woods_1_2options.Description   = "There is no escaping!  Stand and draw your weapon.  Even though you are injured the time has come to end this!";
                Woods_1_2options.LeadsToCombat = true;

                context.PathOption.Add(Woods_1_2options);

                StoryPath WoodsPathFinal = new StoryPath();
                WoodsPathFinal.PathOptionId = Woods_1_2options.Id;
                WoodsPathFinal.RoadBlockId  = Woods_1_2.Id;

                context.StoryPath.Add(WoodsPathFinal);
                context.SaveChanges();

                RoadBlock WoodsFinale1 = new RoadBlock()
                {
                    Description      = "With one final blow, the Lich lets out an agonizing screech and dissipates into a clowd of smoke.  You are vicotrious!  The Lich was unusccessful in creating its phylactery.  You grab the necklace from the ground and venture back towards the village.  You find the woman waiting by the roadside.  You hand her the necklace and she thanks you!  You turn towards the nearest tavern, you deserve a drink!",
                    StartingPoint    = false,
                    AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id,
                    PreviousOptionId = Woods_1_2options.Id,
                };

                context.RoadBlock.Add(WoodsFinale1);
                context.SaveChanges();

                RoadBlock WoodsFinale2 = new RoadBlock()
                {
                    Description      = "With one final blow, the Lich lets out an agonizing screech and dissipates into a clowd of smoke.  You are vicotrious!  The Lich was unusccessful in creating its phylactery.  You grab the necklace from the ground and venture back towards the village.  You find the woman waiting by the roadside.  You hand her the necklace and she thanks you!  You turn towards the nearest tavern, you deserve a drink!",
                    StartingPoint    = false,
                    AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id,
                    PreviousOptionId = optionsWood_1.Single(o => o.Description == "Draw your weapon and prepare for battle!  This creature cannot be allowed to terrorize your people!").Id
                };

                context.RoadBlock.Add(WoodsFinale2);
                context.SaveChanges();



                RoadBlock roadBlock2_2 = new RoadBlock();
                roadBlock2_2.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                roadBlock2_2.Description      = "As you turn to leave the woman becomes angry.  You turn away to head back towards the barracks.  You hear the sound of bones breaking, and cloth ripping.  The moon goes dark and the world rings out with a bellowing roar!";
                roadBlock2_2.PreviousOptionId = options1.Single(o => o.Description == "Keep on walking, this isn't any of your concern.").Id;
                roadBlock2_2.StartingPoint    = false;

                context.RoadBlock.Add(roadBlock2_2);
                context.SaveChanges();

                var options2_2 = new PathOption[]
                {
                    new PathOption()
                    {
                        Description   = "Stop and look back.",
                        LeadsToCombat = false
                    },

                    new PathOption()
                    {
                        Description   = "RUN FAST!",
                        LeadsToCombat = false
                    }
                };

                foreach (PathOption p in options2_2)
                {
                    context.PathOption.Add(p);

                    StoryPath path = new StoryPath();
                    path.RoadBlockId  = roadBlock2_2.Id;
                    path.PathOptionId = p.Id;

                    context.StoryPath.Add(path);
                }
                context.SaveChanges();

                RoadBlock roadBlock3_1 = new RoadBlock();
                roadBlock3_1.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                roadBlock3_1.Description      = "As you turn you see an enormous dragon where the woman once stood.  The dragon is black with glowing red eyes.  Its immense wings unfold from its back.  Smoke and fiery sparks lick from its great jaws.  Clearly the woman was hiding her true nature from you.  The dragon bares takes a step towards you and belows a challanging roar!";
                roadBlock3_1.PreviousOptionId = options2_2.Single(p => p.Description == "Stop and look back.").Id;
                roadBlock3_1.StartingPoint    = false;

                context.RoadBlock.Add(roadBlock3_1);
                context.SaveChanges();

                RoadBlock roadBlock3_2 = new RoadBlock();
                roadBlock3_2.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                roadBlock3_2.Description      = "You run faster than you've ever run before.  From behind you comes a ground shaking roar and you feel the ground shaking beneath you.  You steal a glance behind you and see an enormous dragon barelling towards you!  Clearly the woman wasn't telling you the entire truth.  The woman, now in the form of a immense black dragon, unfurls her immense wings.  The gust of wind from her wings causes you to plummet to the ground.  You roll over on your back to see the behemoth tower above you!  It raises it's head with smoke and fiery sparks escaping its jaws and roars!";
                roadBlock3_2.StartingPoint    = false;
                roadBlock3_2.PreviousOptionId = options2_2.Single(p => p.Description == "RUN FAST!").Id;

                context.RoadBlock.Add(roadBlock3_2);
                context.SaveChanges();

                PathOption option3_1 = new PathOption();
                option3_1.Description   = "Draw your weapon and prepare for battle!";
                option3_1.LeadsToCombat = true;

                context.PathOption.Add(option3_1);
                context.SaveChanges();

                StoryPath path3_1 = new StoryPath();
                path3_1.PathOptionId = option3_1.Id;
                path3_1.RoadBlockId  = roadBlock3_1.Id;

                context.StoryPath.Add(path3_1);
                context.SaveChanges();

                PathOption option3_2 = new PathOption();
                option3_2.Description   = "You roll out of reach of the beasts immense claws.  Get to your feet and draw your weapon.  This Isn't going to be easy.";
                option3_2.LeadsToCombat = true;

                context.PathOption.Add(option3_2);
                context.SaveChanges();

                StoryPath path3_2 = new StoryPath();
                path3_2.PathOptionId = option3_2.Id;
                path3_2.RoadBlockId  = roadBlock3_2.Id;

                RoadBlock roadBlock4_Final = new RoadBlock();
                roadBlock4_Final.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                roadBlock4_Final.Description      = "The dragon let's out one final gutteral roar as it drops lifelessly to the ground.  You dust yourself off, sheath your sword and head to the nearest tavern.  You deserve a drink!";
                roadBlock4_Final.PreviousOptionId = option3_1.Id;
                roadBlock4_Final.StartingPoint    = false;

                context.RoadBlock.Add(roadBlock4_Final);
                context.SaveChanges();

                RoadBlock roadBlock4_2Final = new RoadBlock();
                roadBlock4_2Final.AdventureId      = adventure.Single(a => a.Title == "The Epic One").Id;
                roadBlock4_2Final.Description      = "The dragon let's out one final gutteral roar as it drops lifelessly to the ground.  You dust yourself off, sheath your sword and head to the nearest tavern.  You deserve a drink!";
                roadBlock4_2Final.PreviousOptionId = option3_1.Id;
                roadBlock4_2Final.StartingPoint    = false;

                context.RoadBlock.Add(roadBlock4_2Final);
                context.SaveChanges();
            }
        }