Author: | Baiju Muthukadan |
---|---|
Email: | baiju.m.mail AT gmail.com |
Version: | 0.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gmu.mut; | |
public class Loyalty { | |
/** | |
* Given a a number representing the total dollar amount | |
* of purchases, this returns some discount | |
* */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gmu.mut.test; | |
import static org.junit.Assert.*; | |
import org.junit.Test; | |
import edu.gmu.mut.Account; | |
import edu.gmu.mut.Discount; | |
import edu.gmu.mut.GenreDiscount; | |
import edu.gmu.mut.LoyaltyDiscount; | |
import edu.gmu.mut.Purchase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gmu.mut; | |
import java.util.ArrayList; | |
import java.util.Calendar; | |
/** | |
* Class Account represents an immutable customer account. | |
*/ | |
public class Account { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gmu.mut; | |
import java.util.ArrayList; | |
import java.util.Calendar; | |
/** | |
* Class Account represents an immutable customer account. | |
*/ | |
public class Account { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>JS search algorithm</title> | |
<script> | |
peeps =[ | |
{'Abraham G. Kerr'=[]}, | |
{'Abraham T. Leon'=[]}, | |
{'Adena A. Fox'=[]}, | |
{'Adrian B. Stafford'=[]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//mutation-driven | |
//cause an error; the program should deal with the negative number | |
@Test | |
public void testPurchasesWithNegativeNumbers(){ | |
DiscountCalculator calc = new DiscountCalculator(); | |
dayZero.set(2011, Calendar.JANUARY, 15, 0, 8, 45); | |
Account winner = a(d(-19), d(-4), p("reggae", 8, d(-12)), p("rock-a-billy", -10, d(-7))); | |
Discount d = calc.getSpecialDiscount(winner, d(-1)); | |
//System.out.println( d.getDiscount() ); | |
assertEquals("Probably should throw exception on purchases with negative amounts.", d.getDiscount().multiply(new BigDecimal(100)).intValue()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import static org.junit.Assert.*; | |
import org.junit.Test; | |
import junit.framework.TestCase; | |
public class CoverageTest { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.util.List; | |
import java.util.ArrayList; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @copyright | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |