public LinqValueCalculator(IDiscountHelper discountParam) { discounter = discountParam; System.Diagnostics.Debug.WriteLine( string.Format("Instance {0} created", ++counter)); }
Discount_Between_10_And_100() { //arrange IDiscountHelper target = getTestObject(); // act decimal TenDollarDiscount = target.ApplyDiscount(10); decimal HundredDollarDiscount = target.ApplyDiscount(100); decimal FiftyDollarDiscount = target.ApplyDiscount(50); // assert Assert .AreEqual(5, TenDollarDiscount, "$10 discount is wrong" ); Assert .AreEqual(95, HundredDollarDiscount, "$100 discount is wrong" ); Assert .AreEqual(45, FiftyDollarDiscount, "$50 discount is wrong" ); }
public LinqValueCalculator(IDiscountHelper discount) { this.discounter = discount; System.Diagnostics.Debug.WriteLine( string.Format("Instance {0} create", counter)); }
public void Discount_Negative_Total() {//arrange IDiscountHelper target = getTestObject(); // act target.ApplyDiscount(-1); }
public void Discount_negative_value() { // arrange IDiscountHelper target = getTestObject(); // act target.ApplayDiscount(-1); }
public LinqValueCalculator(IDiscountHelper discountparam) { _discounter = discountparam; // for debug purposes, to count the number of instance that wgere calculated System.Diagnostics.Debug.WriteLine( string.Format("Instance {0} created", ++counter)); }
[ExpectedException(typeof(ArgumentOutOfRangeException))] //assert public void NegativeTotalsNotAllowed() { //arrange IDiscountHelper target = getTestObject(); //act target.ApplyDiscount(-1); }
public void Discount_Negative_Total() { // przygotowanie IDiscountHelper target = getTestObject(); // działanie target.ApplyDiscount(-1); }
public BenefitsCalculationManager(IEmployeeRepository employeeRepository, IBenefitsRepository benefitsRepository, IDiscountHelper discountHelper) { _employeeRepository = employeeRepository; _benefitsRepository = benefitsRepository; _discountHelper = discountHelper; }
public void Discount_Negative_Total() { // 准备 IDiscountHelper target = getTestObject(); // 动作 target.ApplyDiscount(-1); }
public void Discount_Negative_Total() { // arrange (организация) IDiscountHelper target = getTestObject(); // act (акт) target.ApplyDiscount(-1); }
public void Discount_Above_Negative_Total() { // Arrage - 시나리오 설정 IDiscountHelper target = getTestOjbect(); // Act - 작업 시도 target.ApplyDiscount(-1); }
public void Discount_Above_100() { IDiscountHelper target = getTestObject(); decimal total = 200; var discountedTotal = target.ApplyDiscount(total); Assert.AreEqual(total * 0.9M, discountedTotal); }
public void Dicsount_Negative_Total() { // Arrange (시나리오를 설정한다.) IDiscountHelper target = getTestObject(); // Act (작업을 시도한다.) target.ApplyDiscount(-1); }
public WebStoreService() { IKernel standartKernel = new StandardKernel(); NinjectDepKernel ndr = new NinjectDepKernel(standartKernel); IKernel ninjectKernel = ndr.GetKernel(); m_dbe = ninjectKernel.Get <Services.Services.Base.IDataBaseEngine>(); m_dh = ninjectKernel.Get <IDiscountHelper>(); }
[ExpectedException(typeof(ArgumentOutOfRangeException))]//утверждение, которое будет выполнено только в том случае, если модульный тест выбросит исключение типа, указанного параметром ExceptionType.Это аккуратный способ ловить исключения без необходимости возиться с блоками try...catch в юнит тесте. public void Discount_Negative_Total() { //ARRANGE IDiscountHelper target = getTestObject(); //ACT target.ApplyDiscount(-1); //ASSERT }
public void Discount_Less_Than_10() { IDiscountHelper target = getTestObject(); decimal FiveDollarDiscount = target.ApplyDiscount(5); decimal ZoreDollarDiscount = target.ApplyDiscount(0); Assert.AreEqual(5, FiveDollarDiscount); Assert.AreEqual(0, ZoreDollarDiscount); }
public void Discount_Less_Than_10() { IDiscountHelper target = GetTestObject(); decimal discount5 = target.ApplyDiscount(5); decimal discount0 = target.ApplyDiscount(0); Assert.AreEqual(5, discount5); Assert.AreEqual(0, discount0); }
public void ApplyDiscount_PriceBelow10_NoDiscount() { IDiscountHelper discountHelper = GetTestObject(); var DiscountFor7 = discountHelper.ApplyDiscount(7); var DiscountFor0 = discountHelper.ApplyDiscount(0); Assert.AreEqual(7, DiscountFor7, "Discount for $7 is wrong"); Assert.AreEqual(0, DiscountFor0, "Discount for $0 is wrong"); }
public void Discount_Above_100() {// arranged , get test object IDiscountHelper target = getTestObject(); decimal total = 200; // action var discountedTotal = target.ApplyDiscount(total); // assert Assert.AreEqual(total * 0.9M, discountedTotal); }
public void Discount_Above_100() { // Arrange IDiscountHelper target = getTestObject(); decimal total = 200; // Act var discountTotal = target.ApplyDiscount(total); // Assert Assert.AreEqual(total * 0.9M, discountTotal); }
[TestMethod]//отдельными юнит тестами являются методы public void Discount_Above_100() { // PART ARRANGE !!! IDiscountHelper target = getTestObject(); //getTestObject создает экземпляр объекта который собираемся тестировать:MinimumDiscountHelper decimal total = 200; // PART ACT!!! вызываем метод MinimumDiscountHelper.ApplyDiscount и присваиваем результат переменной discountedTotal var discountedTotal = target.ApplyDiscount(total); // PART ASSERT !!! Assert.AreEqual(total * 0.9M, discountedTotal);//метод Assert.AreEqual, для проверки, значения, которые мы получили от метода ApplyDiscount, составляет 90% от первоначальной общей стоимости }
public void TestMethod1() { //Arrange IDiscountHelper taget = getTestOBJ(); Decimal total = 200; //act var discountTotal = taget.ApplyDiscount(total); //assert Assert.AreEqual(total * 0.9M, discountTotal); }
public void Ten_Percent_Default_Discount() { // arrange IDiscountHelper target = getTestObject(); decimal total = 200; // act var discountedTotal = target.ApplyDiscount(total); // assert Assert.AreEqual(180, discountedTotal); }
/// <summary> /// We need to supply our DiscountHelper with discounts from the database before all computed properties will work /// </summary> /// <param name="discounts"></param> public void ApplyDiscounts(IDiscountHelper discountHelper) { DiscountHelper = discountHelper; var dependents = EmployeeDependents.Select(d => d.Dependent).ToList(); foreach (var dependent in dependents) { dependent.ApplyDiscounts(discountHelper); ProccessedDependents.Add(dependent); } }
public void Discount_Between_10_and_100() { IDiscountHelper target = getTestObject(); decimal TenDollarDiscount = target.ApplyDiscount(10); decimal HundredDollarDiscount = target.ApplyDiscount(100); decimal FiftyDollarDiscount = target.ApplyDiscount(50); Assert.AreEqual(5, TenDollarDiscount, "rabat w wysokości 10 zł jest nieprawidłowy"); Assert.AreEqual(95, HundredDollarDiscount, "rabat w wysokości 100 zł jest nieprawidłowy"); Assert.AreEqual(45, FiftyDollarDiscount, "rabat w wysokości 50 zł jest nieprawidłowy"); }
public void DiscountBetween10And100() { IDiscountHelper target = getTestObject(); decimal TenDollarDiscount = target.ApplyDiscount(10); decimal HundredDollarDiscount = target.ApplyDiscount(100); decimal FiftDollarDiscount = target.ApplyDiscount(50); Assert.AreEqual(5, TenDollarDiscount, "$10 discount is wrong"); Assert.AreEqual(95, HundredDollarDiscount, "$100 discount is wrong"); Assert.AreEqual(45, FiftDollarDiscount, "$50 discount is wrong"); }
public void Discount_Less_Than_10() { IDiscountHelper target = getTestObject(); decimal Five = target.ApplyDiscount(5); decimal Zero = target.ApplyDiscount(0); Assert.AreEqual(5, Five); Assert.AreEqual(0, Zero); }
public void Discount_less_Than_10() { //arrange IDiscountHelper target = getTestObject(); //act decimal discount5 = target.ApplyDiscount(5); decimal discount0 = target.ApplyDiscount(0); Assert.AreEqual(5, discount5); Assert.AreEqual(0, discount0); }
public void Discount_Between_10_And_100() { IDiscountHelper target = getTestOBJ(); decimal Tendollar = target.ApplyDiscount(10); decimal hundredollar = target.ApplyDiscount(100); decimal Fiftydollar = target.ApplyDiscount(50); Assert.AreEqual(5, Tendollar, "10달러 아님"); Assert.AreEqual(95, hundredollar, "100달러 아님"); Assert.AreEqual(45, Fiftydollar, "50달러 아님"); }
public LinqValueCalculator(IDiscountHelper discounterParam) { this.discounter = discounterParam; Debug.WriteLine("Instance {0} created", ++instanceNumber); }
public LinqValueCalculator(IDiscountHelper discounter) { this.discounter = discounter; }
public LinqValueCalculator(IDiscountHelper discountParam) { discounter = discountParam; System.Diagnostics.Debug.WriteLine(string.Format("Instance {0} created", ++counter)); }
public LinqValueCalculator(IDiscountHelper discountParam) { discounter = discountParam; }
public LinqValueCalculator(IDiscountHelper discounter) { _discounter = discounter; // throw new NotImplementedException(); }
public IterativeValueCalculator(IDiscountHelper discountParam) { discounter = discountParam; }
public LinqValueCalculator(IDiscountHelper discountParam) { discounter = discountParam; System.Diagnostics.Debug.WriteLine($"Utworzono egzemplarz {++counter}"); }
public LinqValueCalculatorService(IDiscountHelper discounter) { _discounter = discounter; }
public MyValueCalculator(IDiscountHelper a) { discounter = a; }
public LinqValueCalculator(IDiscountHelper helper) { discountHelper = helper; }