public async Task Size(Species species, LengthUnit units) { // Attempt to get the size of the species. SpeciesSizeMatch match = SpeciesSizeMatch.Match(species.Description); // Output the result. EmbedBuilder embed = new EmbedBuilder(); embed.Title = string.Format("Size of {0}", species.FullName); embed.WithDescription(units == LengthUnit.Unknown ? match.ToString() : match.ToString(units)); embed.WithFooter("Size is determined from species description, and may not be accurate."); await ReplyAsync("", false, embed.Build()); }
public void TestToStringWithFeet() { SpeciesSizeMatch match = SpeciesSizeMatch.Match("4.8 feet"); Assert.AreEqual("**1.5 m** (4.8 ft)", match.ToString()); }
public void TestToStringWithCentimeters() { SpeciesSizeMatch match = SpeciesSizeMatch.Match("15 cm"); Assert.AreEqual("**15 cm** (5.9 in)", match.ToString()); }