Exemple #1
0
        public static void TestHomeportParse()
        {
            var provider     = new UnitTestProvider();
            var gameListener = new GameListener(new UnitTestProviderSelector(provider));
            var navalBase    = new NavalBase(gameListener, null, null);

            using (var stream = Assembly.GetExecutingAssembly()
                                .GetManifestResourceStream(typeof(MasterDataTest), "Data.port.2018-05-28_015208.676_START2.json"))
                provider.Push("api_start2", DateTimeOffset.Now, default, stream);
Exemple #2
0
        static MasterDataTest()
        {
            var provider     = new UnitTestProvider();
            var gameListener = new GameProvider(new UnitTestProviderSelector(provider));
            var masterData   = new MasterDataRoot(gameListener);

            gameListener.MasterDataUpdated += (_, u) => parseResult = u;

            using var stream = Assembly.GetExecutingAssembly()
                               .GetManifestResourceStream(typeof(MasterDataTest), "Data.masterdata.json");
            provider.Push("api_start2", DateTimeOffset.Now, default, stream);
Exemple #3
0
        public static void TestHomeportParse()
        {
            var provider     = new UnitTestProvider();
            var gameListener = new GameListener(provider);
            var navalBase    = new NavalBase(gameListener, null, null);

            using (var stream = Assembly.GetExecutingAssembly()
                                .GetManifestResourceStream(typeof(MasterDataTest), "Data.port.2018-05-28_015208.676_START2.json"))
                provider.Push("api_start2", DateTimeOffset.Now, string.Empty, stream);
            using (var stream = Assembly.GetExecutingAssembly()
                                .GetManifestResourceStream(typeof(MasterDataTest), "Data.port.2018-05-28_015210.298_REQUIRE_INFO.json"))
                provider.Push("api_get_member/require_info", DateTimeOffset.Now, string.Empty, stream);
            using (var stream = Assembly.GetExecutingAssembly()
                                .GetManifestResourceStream(typeof(MasterDataTest), "Data.port.2018-05-28_015212.349_PORT.json"))
                provider.Push("api_port/port", DateTimeOffset.Now, string.Empty, stream);
        }
Exemple #4
0
 public UnitTestProviderSelector(UnitTestProvider provider)
 => Current = provider;