Ejemplo n.º 1
0
    public void DuplicatingRecipeThrowsException()
    {
        string[] recipeComponents1 = new string[] { "BootsOfSpeed" };
        IRecipe  recipe1           = new RecipeItemMock("BootsOfTravell", 100, 100, 100, 100, 100, recipeComponents1);

        this.sut.AddRecipeItem(recipe1);

        Assert.Throws <ArgumentException>(() => this.sut.AddRecipeItem(recipe1));
    }
Ejemplo n.º 2
0
    public void CompleteRecipeForNewItem()
    {
        IItem relic = new CommonItemMock("SacredRelic", 0, 0, 0, 0, 60);

        string[] recipeComponents = new string[] { "SacredRelic", "RadianceRecipe" };
        IRecipe  recipe           = new RecipeItemMock("Radiance", 0, 0, 0, 0, 80, recipeComponents);
        IItem    radianceRecipe   = new CommonItemMock("RadianceRecipe", 0, 0, 0, 0, 0);

        this.sut.AddCommonItem(relic);
        this.sut.AddRecipeItem(recipe);
        this.sut.AddCommonItem(radianceRecipe);

        Assert.AreEqual(80, this.sut.TotalDamageBonus);
    }
Ejemplo n.º 3
0
    public void RecipeCompletionChangesStats()
    {
        string[] recipeComponents = new string[] { "Axe", "Shield" };
        IRecipe  recipe           = new RecipeItemMock("MegaWeapon", 100, 100, 100, 100, 100, recipeComponents);
        IItem    axe    = new CommonItemMock("Axe", 10, 10, 10, 10, 10);
        IItem    shield = new CommonItemMock("Shield", 20, 20, 20, 20, 20);

        this.sut.AddCommonItem(axe);
        this.sut.AddCommonItem(shield);
        this.sut.AddRecipeItem(recipe);
        long totalStatsBonus = this.sut.TotalAgilityBonus
                               + this.sut.TotalStrengthBonus
                               + this.sut.TotalIntelligenceBonus
                               + this.sut.TotalHitPointsBonus
                               + this.sut.TotalDamageBonus;

        Assert.AreEqual(500, totalStatsBonus);
    }
Ejemplo n.º 4
0
    public void ChainingRecipes()
    {
        string[] recipeComponents1 = new string[] { "BootsOfSpeed" };
        IRecipe  recipe1           = new RecipeItemMock("BootsOfTravell", 100, 100, 100, 100, 100, recipeComponents1);
        IItem    boots             = new CommonItemMock("BootsOfSpeed", 10, 10, 10, 10, 10);

        string[] recipeComponents2 = new string[] { "BootsOfTravell" };
        IRecipe  recipe2           = new RecipeItemMock("BootsOfTravell2", 200, 200, 200, 200, 200, recipeComponents2);

        this.sut.AddCommonItem(boots);
        this.sut.AddRecipeItem(recipe1);
        this.sut.AddRecipeItem(recipe2);
        long totalStatsBonus = this.sut.TotalAgilityBonus
                               + this.sut.TotalStrengthBonus
                               + this.sut.TotalIntelligenceBonus
                               + this.sut.TotalHitPointsBonus
                               + this.sut.TotalDamageBonus;

        Assert.AreEqual(1000, totalStatsBonus);
    }