public void GetPowderTest() { string[] allp = null; try { allp = GunPowderFactory.GetAllPowderNames(); } catch (Exception) { Assert.Fail("Фабрика не создается"); } Assert.IsNotNull(allp); }
public void PsiTest() { var powders = GunPowderFactory.GetAllPowderNames(); var badPowders = new List <string>(); for (int i = 0; i < powders.Length; i++) { var powder = GunPowder.Factory(powders[i]); bool goodPwdr = powder.Psi(-10) == 0d && powder.Psi(999) == 1d; if (!goodPwdr) { badPowders.Add(powders[i]); } } Assert.AreEqual(0, badPowders.Count); }