public void LoadDataTest(string region)
        {
            IContainer container = ContainerBuilderInit.Create(region);

            using (var scope = container.BeginLifetimeScope())
            {
                ScopedClasses     resolvedClasses   = AutofacUtility.ResolveScope(scope);
                MasterChaldeaInfo masterChaldeaInfo = resolvedClasses.ChaldeaIO.Load();

                using (new AssertionScope())
                {
                    masterChaldeaInfo.Region.Should().Be(region);
                    masterChaldeaInfo.Username.Should().Be("simple_sandman");
                    masterChaldeaInfo.AccountLevel.Should().Be(150);
                    masterChaldeaInfo.FriendCode.Should().Be("999,999,999");
                }
            }
        }
        public void SaveDataTest(string region)
        {
            IContainer container = ContainerBuilderInit.Create(region);

            MasterChaldeaInfo masterChaldeaInfo = new MasterChaldeaInfo
            {
                Region          = region,
                Username        = "******",
                AccountLevel    = 150,
                FriendCode      = "999,999,999",
                ChaldeaServants = new List <ChaldeaServant>(),
                CraftEssences   = new List <CraftEssence>(),
                MysticCodes     = new List <MysticCode>()
            };

            using (var scope = container.BeginLifetimeScope())
            {
                ScopedClasses resolvedClasses = AutofacUtility.ResolveScope(scope);
                resolvedClasses.ChaldeaIO.Save(masterChaldeaInfo);
            }
        }
Ejemplo n.º 3
0
 public void Save(MasterChaldeaInfo masterChaldeaInfo)
 {
     File.WriteAllText(_chaldeaFileLocation, JsonConvert.SerializeObject(masterChaldeaInfo));
 }