Exemple #1
0
        public void ItemEnchantmentArgument_ParseShouldFail()
        {
            // Arrange
            ItemEnchantmentArgument argument = new ItemEnchantmentArgument();
            IStringReader           reader   = new StringReader("foo::bar");

            // Act
            ReadResults readResults = argument.Parse(reader, out _);

            // Assert
            Assert.IsFalse(readResults.Successful);
        }
Exemple #2
0
        public void Enchantments_ShouldNotContainEnchantment()
        {
            // Arrange
            ItemEnchantmentArgument argument = new ItemEnchantmentArgument();

            Enchantments.Set("[\"foo\", \"bar\"]");
            IStringReader reader = new StringReader("baz");

            // Act
            ReadResults readResults = argument.Parse(reader, out _);

            // Assert
            Assert.IsFalse(readResults.Successful);
        }
Exemple #3
0
        public void ItemEnchantmentArgument_ParseShouldSucceed_WithDefaultNamespace()
        {
            // Arrange
            ItemEnchantmentArgument argument = new ItemEnchantmentArgument();

            Enchantments.Set("[\"foo\", \"bar\"]");
            IStringReader reader = new StringReader("minecraft:foo");

            // Act
            ReadResults readResults = argument.Parse(reader, out _);

            // Assert
            Assert.IsTrue(readResults.Successful);
        }