コード例 #1
0
        private void ConvertToText_WrongType_ShouldThrowNotSupportedException()
        {
            var obj    = new object();
            var parser = new UniversalParser();

            Assert.Throws <NotSupportedException>(() => parser.ConvertToText(obj));
        }
コード例 #2
0
        private void ConvertToText_EmptyArmaProfile_ShouldReturnText()
        {
            IConfig armaProfile = new ArmaProfile();
            var     parser      = new UniversalParser();

            var text = parser.ConvertToText(armaProfile);

            Assert.True(!string.IsNullOrEmpty(text));
        }
コード例 #3
0
        private void ConvertToText_EmptyServerConfig_ShouldReturnText()
        {
            IConfig serverConfig = new ServerConfig();
            var     parser       = new UniversalParser();

            var text = parser.ConvertToText(serverConfig);

            Assert.True(!string.IsNullOrEmpty(text));
        }
コード例 #4
0
        private void ConvertToText_ValidArmaProfile_ShouldReturnText()
        {
            IConfig armaProfile = new ArmaProfile
            {
                AiLevelPreset         = 2,
                AreDeathMessagesShown = 1,
                DefaultDifficulty     = "custom",
                TacticalPingType      = 2
            };
            var parser = new UniversalParser();

            var text = parser.ConvertToText(armaProfile);

            Assert.True(!string.IsNullOrEmpty(text));
        }
コード例 #5
0
        private void ConvertToText_ValidServerConfig_ShouldReturnText()
        {
            IConfig serverConfig = new ServerConfig
            {
                AdminPassword         = "******",
                IsPersistent          = 1,
                FilePatchingMode      = 2,
                MaximumPing           = 200,
                IsDrawingOnMapAllowed = true
            };
            var parser = new UniversalParser();

            var text = parser.ConvertToText(serverConfig);

            Assert.True(!string.IsNullOrEmpty(text));
        }
コード例 #6
0
        private void ConvertToText_ValidBasicConfig_ShouldReturnText()
        {
            IConfig basicConfig = new BasicConfig
            {
                MaxBandwidth            = 12312,
                MinBandwidth            = 21312,
                MaxCustomFileSize       = 160,
                MaxMessagesSend         = 321,
                MaxSizeGuaranteed       = 554,
                MaxPacketSize           = 321,
                MaxSizeNonguaranteed    = 213,
                MinErrorToSend          = 0.01F,
                MinErrorToSendNear      = 0.1F,
                ObjectViewDistance      = 2500,
                TerrainGridViewDistance = 25,
                FileLocation            = "C:\\FilePath"
            };
            var parser = new UniversalParser();

            var text = parser.ConvertToText(basicConfig);

            Assert.True(!string.IsNullOrEmpty(text));
        }