2010
Eky Pratama Halim
[UNIT TESTING WORLD MART DENGAN VISUAL STUDIO 2010] Langkah-langkah melakukan UNIT TESTING dengan Visual Studio 2010
Unit Testing Microsoft Visual Studio 2010
UseCase
System
Manager
Mengatur Pembelian
Mengatur Pegawai
Membayar Gaji
<<extend>>
Mengatur Produk
Mengatur Supplier
Kasir
Menambah Penjualan
Administrasi Anggota
Direktur
Mengganti Password
World Mart Information System
Skenario Testing
Test Case ID=WMMP001 (Mengganti Password)
Class Method Input Output Status
PanelUmum btnSubmit_Click(object sender, EventArgs e)
Mainform.curUserId=0005 currentPass=ali newPass=eky rePass=eky
MessageBox.Show("Sukses Mengganti Password");
Pass
PanelumumController public bool changePassword(string id,string curpass, string newpass, string confirm)
Mainform.curUserId=0005 currentPass=ali newPass=eky rePass=eky
true Pass
Test Case ID=WMMP002(Mengganti Password)
Class Method Input Output Status
PanelUmum btnSubmit_Click(object sender, EventArgs e)
Mainform.curUserId=0005 currentPass=eky newPass=ali rePass=ali
MessageBox.Show("Gagal Mengganti Password");
Pass
PanelumumController public bool changePassword(string id,string curpass, string newpass, string confirm)
Mainform.curUserId=0005 currentPass=eky newPass=ali rePass=ali
false Pass
SourceCode Unit Testing:
using WorldMart.Logic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using WorldMart;
namespace WorldMart.Test
{
/// <summary>
///This is a test class for PanelumumControllerTest and is intended
///to contain all PanelumumControllerTest Unit Tests
///</summary>
[TestClass()]
public class PanelumumControllerTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
[TestInitialize()]
public void MyTestInitialize()
{
Logic.Koneksi.host = "localhost";
Logic.Koneksi.serviceName = "XE";
Logic.Koneksi.user = "jeffrey";
Logic.Koneksi.password = "jeffrey";
}
[TestCleanup()]
public void MyTestCleanup()
{
PanelumumController target = new PanelumumController();
target.RollBackPass("0005", "ali");
}
[TestMethod()]
public void changePasswordTest()
{
PanelumumController target = new PanelumumController(); // TODO: Initialize to an appropriate value
string id = "0005"; // TODO: Initialize to an appropriate value
string curpass = "ali"; // TODO: Initialize to an appropriate value
string newpass = "eky"; // TODO: Initialize to an appropriate value
string confirm = "eky"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.changePassword(id, curpass, newpass, confirm);
Assert.AreEqual(expected, actual);
//Assert.Inconclusive("Verify the correctness of this test method.");
}
[TestMethod()]
public void changePasswordTestSalah()
{
PanelumumController target = new PanelumumController(); // TODO: Initialize to an appropriate value
string id = "0005"; // TODO: Initialize to an appropriate value
string curpass = "eky"; // TODO: Initialize to an appropriate value
string newpass = "ali"; // TODO: Initialize to an appropriate value
string confirm = "ali"; // TODO: Initialize to an appropriate value
bool expected = false; // TODO: Initialize to an appropriate value
bool actual;
actual = target.changePassword(id, curpass, newpass, confirm);
Assert.AreEqual(expected, actual);
//Assert.Inconclusive("Verify the correctness of this test method.");
}
}}
Screenshot:
Skenario Testing
Test Case ID=WMCI001 (Mendapatkan ID Pendaftaran)
Class Method Input Output Status
PanelKasirAdministrasi refreshAdministrasiDaftar()
- void
Pass
PanelKasirController public string getCurrentId()
- 0000000008 Pass
Test Case ID=WMCI002 (Mendapatkan ID Member)
Class Method Input Output Status
PanelKasirAdministrasi refreshAdministrasiPerpanjangan()
- void
Pass
PanelKasirController getCurrentMemberId()
- 0000000008 Pass
Test Case ID=WMCI003 (Mengecek Field Kosong)
Class Method Input Output Status
PanelKasirAdministrasi private void button7_Click(object sender, EventArgs e)
- true
Pass
PanelKasirController insert(idAngg, nama, alamat, telpon, tglbatas, tgldaftar);
string idAngg = "0000000008"; string nama = "Shandy"; string alamat = "Sorento H2-20"; string telpon = "08127676225"; string tglbatas = "Wednesday, June 02,2010"; string tgldaftar = "Thursday, June 02,2011"; // string adminis1 = "0000000008"; string jenis = "0000000002"; int p = 75000; string idPeg = "0005"; string anggota1 = "";
true Pass
Test Case ID=WMCI004 (Mengecek Field Kosong)
Class Method Input Output Status
PanelKasirAdministrasi private void button7_Click(object sender, EventArgs e)
- false
Pass
PanelKasirController insert(idAngg, nama, alamat, telpon, tglbatas, tgldaftar);
string idAngg = "0000000008"; string nama = ""; string alamat = "Sorento H2-20"; string telpon = "08127676225"; string tglbatas = "Wednesday, June 02,2010"; string tgldaftar = "Thursday, June 02,2011"; // string adminis1 = "0000000008"; string jenis = "0000000002"; int p = 75000; string idPeg = "0005"; string anggota1 = "";
false Pass
SourceCode Unit Testing:
using WorldMart.Logic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace WorldMart.Test
{
/// <summary>
///This is a test class for KasirAdministrasiControllerTest and is intended
///to contain all KasirAdministrasiControllerTest Unit Tests
///</summary>
[TestClass()]
public class KasirAdministrasiControllerTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
#endregion
[TestInitialize()]
public void MyTestInitialize()
{
Logic.Koneksi.host = "localhost";
Logic.Koneksi.serviceName = "XE";
Logic.Koneksi.user = "jeffrey";
Logic.Koneksi.password = "jeffrey";
}
[TestMethod()]
public void insertTest()
{
KasirAdministrasiController target = new KasirAdministrasiController(); // TODO: Initialize to an appropriate value
string idAngg = "0000000008"; // TODO: Initialize to an appropriate value
string nama = "Shandy"; // TODO: Initialize to an appropriate value
string alamat = "Sorento H2-20"; // TODO: Initialize to an appropriate value
string telpon = "08127676225"; // TODO: Initialize to an appropriate value
string tglbatas = ""; // TODO: Initialize to an appropriate value
string tgldaftar = ""; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.insert(idAngg, nama, alamat, telpon, tglbatas, tgldaftar);
Assert.AreEqual(expected, actual);
}
[TestMethod()]
public void insertTest2()
{
KasirAdministrasiController target = new KasirAdministrasiController(); // TODO: Initialize to an appropriate value
string idAngg = "0000000008"; // TODO: Initialize to an appropriate value
string nama = ""; // TODO: Initialize to an appropriate value
string alamat = "Sorento H2-20"; // TODO: Initialize to an appropriate value
string telpon = "08127676225"; // TODO: Initialize to an appropriate value
string tglbatas = ""; // TODO: Initialize to an appropriate value
string tgldaftar = ""; // TODO: Initialize to an appropriate value
bool expected = false; // TODO: Initialize to an appropriate value
bool actual;
actual = target.insert(idAngg, nama, alamat, telpon, tglbatas, tgldaftar);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for getCurrentMemberId
///</summary>
[TestMethod()]
public void getCurrentMemberIdTest()
{
KasirAdministrasiController target = new KasirAdministrasiController(); // TODO: Initialize to an appropriate value
string expected = "0000000008"; // TODO: Initialize to an appropriate value
string actual;
actual = target.getCurrentMemberId();
Assert.AreEqual(expected, actual);
//Assert.Inconclusive("Verify the correctness of this test method.");
}
/// <summary>
///A test for getCurrentId
///</summary>
[TestMethod()]
public void getCurrentIdTest()
{
KasirAdministrasiController target = new KasirAdministrasiController(); // TODO: Initialize to an appropriate value
string expected = "0000000008"; // TODO: Initialize to an appropriate value
string actual;
actual = target.getCurrentId();
Assert.AreEqual(expected, actual);
//Assert.Inconclusive("Verify the correctness of this test method.");
}
}
}
Skenario Testing
Test Case ID=WMPK001 (Update Stock)
Class Method Input Output Status
PanelKasir private void button5_Click(object sender, EventArgs e)
Jumlah=1 Id= 00000000000000000005 Operat=1
true Pass
PanelKasirController public bool updateStock(string jumlah, string id,int operat)
Jumlah=1 Id= 00000000000000000005 Operat=1
true Pass
Test Case ID=WMPK002 (Get ID Penjualan)
Class Method Input Output Status
PanelKasir refreshPenjualan()
- 0000000021 Pass
PanelKasirController public string getJualId()
- 0000000021 Pass
Test Case ID=WMPK003 (Get Detail Produk)
Class Method Input Output Status
PanelKasir refreshPenjualan()
- OracleDataReader object Pass
PanelKasirController public OracleDataReader getDetailProduk()
- OracleDataReader object Pass
Test Case ID=WMPK004 (Get Category)
Class Method Input Output Status
PanelKasir refreshPenjualan()
- OracleDataReader object Pass
PanelKasirController public OracleDataReader getCategory()
- OracleDataReader object Pass
Test Case ID=WMPK005 (Cek Stock)
Class Method Input Output Status
PanelKasir private void button5_Click(object sender, EventArgs e)
id=
00000000000000000005
OracleDataReader object Pass
PanelKasirController public OracleDataReader cekStock(string id)
id=
00000000000000000005
OracleDataReader object Pass
Test Case ID=WMPK006 (Cek Keanggotaan)
Class Method Input Output Status
PanelKasir private void button5_Click(object sender, EventArgs e)
id= 0000000007
true
Pass
PanelKasirController public bool cekKeanggotaan(string idAnggota)
id= 0000000007
true Pass
Test Case ID=WMPK007 (Cek Kadaluarsa)
Class Method Input Output Status
PanelKasir private void button5_Click(object sender, EventArgs e)
id=
00000000000000000005
OracleDataReader object
Pass
PanelKasirController public OracleDataReader cekKadaluarsa(string idProduk)
id=
00000000000000000005
OracleDataReader object Pass
Test Case ID=WMPK008 (Penambahan Transaksi Penjualan)
Class Method Input Output Status
PanelKasir private void button5_Click(object sender, EventArgs e)
string p = "0000000020"; string idAnggota = "0000000002"; string idPegawai = "0005"; string idProduk = "00000000000000000005"; string jmlh = "1"; hrg = "98000"; bool first = true;
OracleDataReader object
Pass
PanelKasirController public OracleDataReader cekKadaluarsa(string idProduk)
string p = "0000000020"; string idAnggota = "0000000002"; string idPegawai = "0005"; string idProduk = "00000000000000000005"; string jmlh = "1"; hrg = "98000"; bool first = true;
OracleDataReader object Pass
SourceCode Unit Testing:
using WorldMart.Logic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Oracle.DataAccess.Client;
namespace WorldMart.Test
{
/// <summary>
///This is a test class for PanelKasirControllerTest and is intended
///to contain all PanelKasirControllerTest Unit Tests
///</summary>
[TestClass()]
public class PanelKasirControllerTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
[TestInitialize()]
public void MyTestInitialize()
{
Logic.Koneksi.host = "localhost";
Logic.Koneksi.serviceName = "XE";
Logic.Koneksi.user = "jeffrey";
Logic.Koneksi.password = "jeffrey";
}
#endregion
/// <summary>
///A test for addTransaksiJual
///</summary>
[TestMethod()]
public void addTransaksiJualTest()
{
PanelKasirController target = new PanelKasirController(); // TODO: Initialize to an appropriate value
string p = "0000000020"; // TODO: Initialize to an appropriate value
string idAnggota = "0000000002"; // TODO: Initialize to an appropriate value
string idPegawai = "0005"; // TODO: Initialize to an appropriate value
string idProduk = "00000000000000000005"; // TODO: Initialize to an appropriate value
string jmlh = "1"; // TODO: Initialize to an appropriate value
string hrg = "98000"; // TODO: Initialize to an appropriate value
bool first = true; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.addTransaksiJual(p, idAnggota, idPegawai, idProduk, jmlh, hrg, first);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for cekKadaluarsa
///</summary>
[TestMethod()]
public void cekKadaluarsaTest()
{
PanelKasirController target = new PanelKasirController(); // TODO: Initialize to an appropriate value
string idProduk = "00000000000000000005"; // TODO: Initialize to an appropriate value
OracleDataReader expected = null; // TODO: Initialize to an appropriate value
OracleDataReader actual;
actual = target.cekKadaluarsa(idProduk);
Assert.AreNotEqual(expected, actual);
}
/// <summary>
///A test for cekKeanggotaan
///</summary>
[TestMethod()]
public void cekKeanggotaanTest()
{
PanelKasirController target = new PanelKasirController(); // TODO: Initialize to an appropriate value
string idAnggota = "0000000007"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.cekKeanggotaan(idAnggota);
Assert.AreEqual(expected, actual);
// Assert.Inconclusive("Verify the correctness of this test method.");
}
/// <summary>
///A test for cekStock
///</summary>
[TestMethod()]
public void cekStockTest()
{
PanelKasirController target = new PanelKasirController(); // TODO: Initialize to an appropriate value
string id = "00000000000000000005"; // TODO: Initialize to an appropriate value
OracleDataReader expected = null; // TODO: Initialize to an appropriate value
OracleDataReader actual;
actual = target.cekStock(id);
Assert.AreNotEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
/// <summary>
///A test for getCategory
///</summary>
[TestMethod()]
public void getCategoryTest()
{
PanelKasirController target = new PanelKasirController(); // TODO: Initialize to an appropriate value
OracleDataReader expected = null; // TODO: Initialize to an appropriate value
OracleDataReader actual;
actual = target.getCategory();
Assert.AreNotEqual(expected, actual);
}
/// <summary>
///A test for getDetailProduk
///</summary>
[TestMethod()]
public void getDetailProdukTest()
{
PanelKasirController target = new PanelKasirController(); // TODO: Initialize to an appropriate value
OracleDataReader expected = null; // TODO: Initialize to an appropriate value
OracleDataReader actual;
actual = target.getDetailProduk();
Assert.AreNotEqual(expected,actual);
}
/// <summary>
///A test for getIdAnggota
///</summary>
/// <summary>
///A test for getJualId
///</summary>
[TestMethod()]
public void getJualIdTest()
{
PanelKasirController target = new PanelKasirController(); // TODO: Initialize to an appropriate value
string expected = "0000000018"; // TODO: Initialize to an appropriate value
string actual;
actual = target.getJualId();
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for updateStock
///</summary>
[TestMethod()]
public void updateStockTest()
{
PanelKasirController target = new PanelKasirController(); // TODO: Initialize to an appropriate value
string jumlah = "1"; // TODO: Initialize to an appropriate value
string id = "00000000000000000005"; // TODO: Initialize to an appropriate value
int operat = 1; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.updateStock(jumlah, id, operat);
Assert.AreEqual(expected, actual);
}
}}
Screenshot Testing:
Test Case ID=WMTP001 (Update Produk)
Class Method Input Output Status
PanelManager private void btnSubmit_Click(object sender, EventArgs e)
Jumlah=1 Idproduk=
00000000000000000005
true
Pass
PanelManagerController public bool updateProduk(string jumlah, string idProduk)
Jumlah=1 Idproduk=
00000000000000000005
true Pass
Test Case ID=WMTP002 (ID Produk Baru)
Class Method Input Output Status
PanelManager private void btnAdd_Click(object sender, EventArgs e)
counterNewProduct=8 00000000000000000021
Pass
PanelManagerController public string newId(string counterNewProduk)
counterNewProduct=8
00000000000000000021
Pass
Test Case ID=WMTP003 (Insert Transaksi Beli)
Class Method Input Output Status
PanelManager private void btnSubmit_Click(object sender, EventArgs e)
P=00000000021 P_2= 00000003
P_3= 0004
true
Pass
PanelManagerController public string newId(string counterNewProduk)
counterNewProduct=8
true
Pass
Test Case ID=WMTP004 (Insert Produk)
Class Method Input Output Status
PanelManager private void btnSubmit_Click(object sender, EventArgs e)
string idProduk = "00000000022"; string idKategori = "00000003"; string namaProduk = "Televisi Flat"; string jumlah = "10"; string btsTglDisplay = "Thursday, June 03,2010";
true
Pass
PanelManagerController public bool insertProduk(string idProduk, string idKategori, string namaProduk, string jumlah, string btsTglDisplay)
string idProduk = "00000000022"; string idKategori = "00000003"; string namaProduk = "Televisi Flat"; string jumlah = "10"; string btsTglDisplay = "Thursday, June 03,2010";
true
Pass
Test Case ID=WMTP005 (Insert Detail Transaksi Pembelian Produk)
Class Method Input Output Status
PanelManager private void btnSubmit_Click(object sender, EventArgs e)
string idProduk = "000000000000000000002"; string p = "0000000022"; string jumlah = "10"; string hb = "300"; string btsTglDisplay = "6-3-10";
true
Pass
PanelManagerController public bool insertDetailTransaksiBeli(string idProduk, string p, string jumlah, string hb, string btsTglDisplay, string hr)
string idProduk = "000000000000000000002"; string p = "0000000022"; string jumlah = "10"; string hb = "300"; string btsTglDisplay = "6-3-10";
true
Pass
SourceCode Unit Testing:
using WorldMart.Logic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Oracle.DataAccess.Client;
namespace WorldMart.Test
{
[TestClass()]
public class PanelManagerControllerTest
{
private TestContext testContextInstance;
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
[TestInitialize()]
public void MyTestInitialize()
{
Logic.Koneksi.host = "localhost";
Logic.Koneksi.serviceName = "XE";
Logic.Koneksi.user = "jeffrey";
Logic.Koneksi.password = "jeffrey";
}
/// <summary>
[TestMethod()]
public void insertDetailTransaksiBeliTest()
{
PanelManagerController target = new PanelManagerController(); // TODO: Initialize to an appropriate value
string idProduk = "000000000000000000002"; // TODO: Initialize to an appropriate value
string p = "0000000022"; // TODO: Initialize to an appropriate value
string jumlah = "10"; // TODO: Initialize to an appropriate value
string hb = "300"; // TODO: Initialize to an appropriate value
string btsTglDisplay = "6-3-10"; // TODO: Initialize to an appropriate value
string hr = "200"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.insertDetailTransaksiBeli(idProduk, p, jumlah, hb, btsTglDisplay, hr);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for insertProduk
///</summary>
[TestMethod()]
public void insertProdukTest()
{
PanelManagerController target = new PanelManagerController(); // TODO: Initialize to an appropriate value
string idProduk = "00000000022"; // TODO: Initialize to an appropriate value
string idKategori = "00000003"; // TODO: Initialize to an appropriate value
string namaProduk = "Televisi Flat"; // TODO: Initialize to an appropriate value
string jumlah = "10"; // TODO: Initialize to an appropriate value
string btsTglDisplay = "Thursday, June 03,2010"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.insertProduk(idProduk, idKategori, namaProduk, jumlah, btsTglDisplay);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for insertTransaksiBeli
///</summary>
[TestMethod()]
public void insertTransaksiBeliTest()
{
PanelManagerController target = new PanelManagerController(); // TODO: Initialize to an appropriate value
string p = "00000000021"; // TODO: Initialize to an appropriate value
string p_2 = "00000003"; // TODO: Initialize to an appropriate value
string p_3 = "0004"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.insertTransaksiBeli(p, p_2, p_3);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for newId
///</summary>
[TestMethod()]
public void newIdTest()
{
PanelManagerController target = new PanelManagerController(); // TODO: Initialize to an appropriate value
string counterNewProduk = "8"; // TODO: Initialize to an appropriate value
string expected = "00000000000000000021"; // TODO: Initialize to an appropriate value
string actual;
actual = target.newId(counterNewProduk);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for updateProduk
///</summary>
[TestMethod()]
public void updateProdukTest()
{
PanelManagerController target = new PanelManagerController(); // TODO: Initialize to an appropriate value
string jumlah = "1"; // TODO: Initialize to an appropriate value
string idProduk = "00000000000000000005"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.updateProduk(jumlah, idProduk);
Assert.AreEqual(expected, actual);
}
}
}
Skenario Testing
Test Case ID=WMPM001 (Update Gaji Pegawai)
Class Method Input Output Status
PanelManagerPegawai private void btnSubmitPeg_Click(object sender, EventArgs e)
string idPeg = "0005"; bool isPegTetapBefore = false; bool isPegTetapAfter = true; string tunjanganPeg = "500000"; string tglMsk = "6-3-2010"; string tglAkhir ="6-3-2010";
true
Pass
PanelManagerController public bool UpdateGajiKontrakPegawai(string idPeg, bool isPegTetapBefore, bool isPegTetapAfter, string tunjanganPeg, string tglMsk, string tglAkhir)
string idPeg = "0005"; bool isPegTetapBefore = false; bool isPegTetapAfter = true; string tunjanganPeg = "500000"; string tglMsk = "6-3-2010"; string tglAkhir ="6-3-2010";
true Pass
Test Case ID=WMPM002 (Update Pegawai)
Class Method Input Output Status
PanelManagerPegawai private void btnSubmitPeg_Click(object sender, EventArgs e)
string idPeg = "0005"; string idJabPeg = "0000000005"; string namaPeg = "ali"; string alamatPeg = "Santa Barbara"; string telpPeg = "081321030203"; string tglMsk = "6-3-2010"; string sourceLoc = "Riau"
true
Pass
PanelManagerController public bool UpdatePegawai( string idPeg, string idJabPeg, string namaPeg, string alamatPeg, string telpPeg, string tglMsk, string sourceLoc)
string idPeg = "0005"; string idJabPeg = "0000000005"; string namaPeg = "ali"; string alamatPeg = "Santa Barbara"; string telpPeg = "081321030203"; string tglMsk = "6-3-2010"; string sourceLoc = "Riau"
true Pass
Test Case ID=WMPM003(Remove Pegawai)
Class Method Input Output Status
PanelManagerPegawai private void btnRemove_Click(object sender, EventArgs e)
string idPeg = "0012";
true
Pass
PanelManagerController public bool RemovePegawai(string idPegawai)
string idPeg = "0012"; true Pass
Test Case ID=WMPM004(Remove Pegawai)
Class Method Input Output Status
PanelManagerPegawai private void btnRemove_Click(object sender, EventArgs e)
string idPeg = "0013";
false
Pass
PanelManagerController public bool RemovePegawai(string idPegawai)
string idPeg = "0012"; false Pass
Test Case ID=WMPM005(Add Pegawai)
Class Method Input Output Status
PanelManagerPegawai private void btnSubmitPeg_Click(object sender, EventArgs e)
string idPeg = "0014"; string idJabPeg = "0000000005"; string namaPeg = "Indra Setyawan"; string alamatPeg = "San Diego"; string telpPeg = "135432232"; string tglMsk = "6-3-2010"; string sourceLoc = "Mandau";
true
Pass
PanelManagerController public bool AddPegawai(string idPeg, string idJabPeg, string namaPeg, string alamatPeg, string telpPeg, string tglMsk, string sourceLoc)
string idPeg = "0014"; string idJabPeg = "0000000005"; string namaPeg = "Indra Setyawan"; string alamatPeg = "San Diego"; string telpPeg = "135432232"; string tglMsk = "6-3-2010"; string sourceLoc = "Mandau";
true Pass
Test Case ID=WMPM006(Add Gaji Pegawai Kontrak)
Class Method Input Output Status
PanelManagerPegawai private void btnSubmitPeg_Click(object sender, EventArgs e)
string idPeg = "0005"; bool isPegTetapAfter = true; string tunjanganPeg = "500000"; string tglMsk = "6-1-2010"; string tglAkhir = "6-3-2010";
true
Pass
PanelManagerController public bool AddGajiKontrakPegawai(string idPeg, bool isPegTetapAfter, string tunjanganPeg, string tglMsk, string tglAkhir)
string idPeg = "0005"; bool isPegTetapAfter = true; string tunjanganPeg = "500000"; string tglMsk = "6-1-2010"; string tglAkhir = "6-3-2010";
true Pass
SourceCode Unit Testing:
using WorldMart.Logic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace WorldMart.Test
{
/// <summary>
///This is a test class for PegawaiControllerTest and is intended
///to contain all PegawaiControllerTest Unit Tests
///</summary>
[TestClass()]
public class PegawaiControllerTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
[TestMethod()]
public void AddGajiKontrakPegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPeg = "0005"; // TODO: Initialize to an appropriate value
bool isPegTetapAfter = true; // TODO: Initialize to an appropriate value
string tunjanganPeg = "500000"; // TODO: Initialize to an appropriate value
string tglMsk = "6-1-2010"; // TODO: Initialize to an appropriate value
string tglAkhir = "6-3-2010"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.AddGajiKontrakPegawai(idPeg, isPegTetapAfter, tunjanganPeg, tglMsk, tglAkhir);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
/// <summary>
///A test for AddPegawai
///</summary>
[TestMethod()]
public void AddPegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPeg = "0014"; // TODO: Initialize to an appropriate value
string idJabPeg = "0000000005"; // TODO: Initialize to an appropriate value
string namaPeg = "Indra Setyawan"; // TODO: Initialize to an appropriate value
string alamatPeg = "San Diego"; // TODO: Initialize to an appropriate value
string telpPeg = "135432232"; // TODO: Initialize to an appropriate value
string tglMsk = "6-3-2010"; // TODO: Initialize to an appropriate value
string sourceLoc = "Mandau"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.AddPegawai(idPeg, idJabPeg, namaPeg, alamatPeg, telpPeg, tglMsk, sourceLoc);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for RemovePegawai
///</summary>
[TestMethod()]
public void RemovePegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPegawai ="0012"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.RemovePegawai(idPegawai);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
[TestMethod()]
public void RemovePegawaiSalahTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPegawai = "0013"; // TODO: Initialize to an appropriate value
bool expected = false; // TODO: Initialize to an appropriate value
bool actual;
actual = target.RemovePegawai(idPegawai);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
/// <summary>
///A test for UpdatePegawai
///</summary>
[TestMethod()]
public void UpdatePegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPeg = "0005"; // TODO: Initialize to an appropriate value
string idJabPeg = "0000000005"; // TODO: Initialize to an appropriate value
string namaPeg = "ali"; // TODO: Initialize to an appropriate value
string alamatPeg = "Santa Barbara"; // TODO: Initialize to an appropriate value
string telpPeg = "081321030203"; // TODO: Initialize to an appropriate value
string tglMsk = "6-3-2010"; // TODO: Initialize to an appropriate value
string sourceLoc = "Riau"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.UpdatePegawai(idPeg, idJabPeg, namaPeg, alamatPeg, telpPeg, tglMsk, sourceLoc);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for UpdateGajiKontrakPegawai
///</summary>
[TestMethod()]
public void UpdateGajiKontrakPegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPeg = "0005"; // TODO: Initialize to an appropriate value
bool isPegTetapBefore = false; // TODO: Initialize to an appropriate value
bool isPegTetapAfter = true; // TODO: Initialize to an appropriate value
string tunjanganPeg = "500000"; // TODO: Initialize to an appropriate value
string tglMsk = "6-3-2010"; // TODO: Initialize to an appropriate value
string tglAkhir ="6-3-2010"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.UpdateGajiKontrakPegawai(idPeg, isPegTetapBefore, isPegTetapAfter, tunjanganPeg, tglMsk, tglAkhir);
Assert.AreEqual(expected, actual);
}
Skenario Testing
Test Case ID=WMRM001(Update Produk)
Class Method Input Output Status
PanelManagerProduk
private void btnSubmitPro_Click(object sender, EventArgs e)
string id = "00000000000000000004"; string nama = "Meja Bintang Singa"; string kategori = "00000004"; Decimal hargaNormal = new Decimal(9000); Decimal hargaAnggota = new Decimal(7000); Decimal jumlah = new Decimal(5); string tglDisplay = "6-3-2010"; string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio 2010\\Project\\FpVervalv1.1\\WorldMart\\WorldMart \\images\\1244988228_users.png";
true
Pass
ProdukController public bool UpdateProduk(string id, string nama, string kategori, decimal hargaNormal, decimal hargaAnggota, decimal jumlah, string tglDisplay, string sourceLoc)
string id = "00000000000000000004"; string nama = "Meja Bintang Singa"; string kategori = "00000004"; Decimal hargaNormal = new Decimal(9000); Decimal hargaAnggota = new Decimal(7000); Decimal jumlah = new Decimal(5); string tglDisplay = "6-3-2010"; string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio 2010\\Project\\FpVervalv1.1\\WorldMart\\WorldMart \\images\\1244988228_users.png";
true Pass
Test Case ID=WMRM002(Get Data Produk)
Class Method Input Output Status
PanelManagerProduk public bool RefreshDataProduk()
string idPro = "00000000000000000004"
Produk p
Pass
ProdukController public Produk GetDataProduk(string idPro)
string idPro = "00000000000000000004"
Produk p Pass
SourceCode Unit Testing:
using WorldMart.Logic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace WorldMart.Test
{
/// <summary>
///This is a test class for ProdukControllerTest and is intended
///to contain all ProdukControllerTest Unit Tests
///</summary>
[TestClass()]
public class ProdukControllerTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
/
[TestInitialize()]
public void MyTestInitialize()
{
Logic.Koneksi.host = "localhost";
Logic.Koneksi.serviceName = "XE";
Logic.Koneksi.user = "jeffrey";
Logic.Koneksi.password = "jeffrey";
}
/// <summary>
///A test for UpdateProduk
///</summary>
[TestMethod()]
public void UpdateProdukTest()
{
ProdukController target = new ProdukController(); // TODO: Initialize to an appropriate value
string id = "00000000000000000004"; // TODO: Initialize to an appropriate value
string nama = "Meja Bintang Singa"; // TODO: Initialize to an appropriate value
string kategori = "00000004"; // TODO: Initialize to an appropriate value
Decimal hargaNormal = new Decimal(9000); // TODO: Initialize to an appropriate value
Decimal hargaAnggota = new Decimal(7000); // TODO: Initialize to an appropriate value
Decimal jumlah = new Decimal(5); // TODO: Initialize to an appropriate value
string tglDisplay = "6-3-2010"; // TODO: Initialize to an appropriate value
string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio
2010\\Project\\FpVervalv1.1\\WorldMart\\WorldMart\\images\\1244988228_users.png"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.UpdateProduk(id, nama, kategori, hargaNormal, hargaAnggota, jumlah, tglDisplay, sourceLoc);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for GetDataProduk
///</summary>
[TestMethod()]
public void GetDataProdukTest()
{
ProdukController target = new ProdukController(); // TODO: Initialize to an appropriate value
string idPro = "00000000000000000004"; // TODO: Initialize to an appropriate value
Produk expected = null; // TODO: Initialize to an appropriate value
Produk actual;
actual = target.GetDataProduk(idPro);
Assert.AreNotEqual(expected, actual);
}
}
}
Skenario Testing
Test Case ID=WMSM001(Add Supplier)
Class Method Input Output
PanelManagerSupplier private void btnSubmitSup_Click(object sender, EventArgs e)
string id = "00000007"; string nama = "Pacific Computer"; string alamat = "Jalan Nagoya Batam"; string telp = "076135228"; string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio 2010\\Project \\FpVervalv1.1\\WorldMart \\WorldMart\\images \\1244988228_users.png";
true
SupplierController public bool AddSupplier(string id, string nama, string alamat, string telp, string sourceLoc)
string id = "00000007"; string nama = "Pacific Computer"; string alamat = "Jalan Nagoya Batam"; string telp = "076135228"; string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio 2010\\Project \\FpVervalv1.1\\WorldMart \\WorldMart\\images \\1244988228_users.png";
true
Test Case ID=WMSM001(Add Supplier)
Class Method Input Output Status
PanelManagerSupplier private void btnSubmitSup_Click(object sender, EventArgs e)
string id = "00000007"; string nama = "Pacific Computer"; string alamat = "Jalan Nagoya Batam"; string telp = "076135228"; string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio 2010\\Project \\FpVervalv1.1\\WorldMart \\WorldMart\\images \\1244988228_users.png";
true
Pass
SupplierController public bool AddSupplier(string id, string nama, string alamat, string telp, string sourceLoc)
string id = "00000007"; string nama = "Pacific Computer"; string alamat = "Jalan Nagoya Batam"; string telp = "076135228"; string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio 2010\\Project \\FpVervalv1.1\\WorldMart \\WorldMart\\images \\1244988228_users.png";
true Pass
Test Case ID=WMSM002(Get Data Supplier)
Class Method Input Output Status
PanelManagerSupplier public bool RefreshDataSupplier()
idSupplier=” 00000001” Supplier s
Pass
SupplierController public Supplier GetDataSupplier(string idSupplier)
idSupplier=” 00000001” Supplier s Pass
Test Case ID=WMSM003(Update Supplier)
Class Method Input Output Status
PanelManagerSupplier private void btnSubmitSup_Click(object sender, EventArgs e)
string id = "00000001"; string nama = "PT.MI"; string alamat = "Bawal Batu Ampar"; string telp = "4555763"; string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio 2010\\Project\\FpVervalv1.1 \\WorldMart \\WorldMart\\images \\1244988228_users.png";
true
Pass
SupplierController public bool UpdateSupplier( string id, string nama, string alamat, string telp, string sourceLoc)
string id = "00000001"; string nama = "PT.MI"; string alamat = "Bawal Batu Ampar"; string telp = "4555763"; string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio 2010\\Project\\FpVervalv1.1 \\WorldMart \\WorldMart\\images \\1244988228_users.png";
true Pass
SourceCode Unit Testing:
using WorldMart.Logic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace WorldMart.Test
{
[TestClass()]
public class SupplierControllerTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
[TestInitialize()]
public void MyTestInitialize()
{
Logic.Koneksi.host = "localhost";
Logic.Koneksi.serviceName = "XE";
Logic.Koneksi.user = "jeffrey";
Logic.Koneksi.password = "jeffrey";
}
/// <summary>
///A test for UpdateSupplier
///</summary>
[TestMethod()]
public void UpdateSupplierTest()
{
SupplierController target = new SupplierController(); // TODO: Initialize to an appropriate value
string id = "00000001"; // TODO: Initialize to an appropriate value
string nama = "PT.MI"; // TODO: Initialize to an appropriate value
string alamat = "Bawal Batu Ampar"; // TODO: Initialize to an appropriate value
string telp = "4555763"; // TODO: Initialize to an appropriate value
string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio
2010\\Project\\FpVervalv1.1\\WorldMart\\WorldMart\\images\\1244988228_users.png"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.UpdateSupplier(id, nama, alamat, telp, sourceLoc);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
/// <summary>
///A test for GetDataSupplier
///</summary>
[TestMethod()]
public void GetDataSupplierTest()
{
SupplierController target = new SupplierController(); // TODO: Initialize to an appropriate value
string idSupplier = "00000001"; // TODO: Initialize to an appropriate value
Supplier expected = null; // TODO: Initialize to an appropriate value
Supplier actual;
actual = target.GetDataSupplier(idSupplier);
Assert.AreNotEqual(expected, actual);
}
/// <summary>
///A test for AddSupplier
///</summary>
[TestMethod()]
public void AddSupplierTest()
{
SupplierController target = new SupplierController(); // TODO: Initialize to an appropriate value
string id = "00000007"; // TODO: Initialize to an appropriate value
string nama = "Pacific Computer"; // TODO: Initialize to an appropriate value
string alamat = "Jalan Nagoya Batam"; // TODO: Initialize to an appropriate value
string telp = "076135228"; // TODO: Initialize to an appropriate value
string sourceLoc = "C:\\Documents and Settings\\My PC\\My Documents\\Visual Studio
2010\\Project\\FpVervalv1.1\\WorldMart\\WorldMart\\images\\1244988228_users.png"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.AddSupplier(id, nama, alamat, telp, sourceLoc);
Skenario Testing
Merupakan Panel yang di-Extend dari Panel Manager Pegawai Sehingga Menggunakan UNIT TEST yang sama.
Test Case ID=WMPM001 (Update Gaji Pegawai)
Class Method Input Output Status
PanelBosPegawai private void btnSubmitPeg_Click(object sender, EventArgs e)
string idPeg = "0005"; bool isPegTetapBefore = false; bool isPegTetapAfter = true; string tunjanganPeg = "500000"; string tglMsk = "6-3-2010"; string tglAkhir ="6-3-2010";
true
Pass
PanelManagerController public bool UpdateGajiKontrakPegawai(string idPeg, bool isPegTetapBefore, bool isPegTetapAfter, string tunjanganPeg, string tglMsk,
string idPeg = "0005"; bool isPegTetapBefore = false; bool isPegTetapAfter = true; string tunjanganPeg = "500000"; string tglMsk = "6-3-2010"; string tglAkhir ="6-3-2010";
true Pass
string tglAkhir)
Test Case ID=WMPM002 (Update Pegawai)
Class Method Input Output Status
PanelBosPegawai private void btnSubmitPeg_Click(object sender, EventArgs e)
string idPeg = "0005"; string idJabPeg = "0000000005"; string namaPeg = "ali"; string alamatPeg = "Santa Barbara"; string telpPeg = "081321030203"; string tglMsk = "6-3-2010"; string sourceLoc = "Riau"
true
Pass
PanelManagerController public bool UpdatePegawai( string idPeg, string idJabPeg, string namaPeg, string alamatPeg, string telpPeg, string tglMsk,
string idPeg = "0005"; string idJabPeg = "0000000005"; string namaPeg = "ali"; string alamatPeg = "Santa Barbara"; string telpPeg = "081321030203"; string tglMsk = "6-3-2010"; string sourceLoc = "Riau"
true Pass
string sourceLoc)
Test Case ID=WMPM003(Remove Pegawai)
Class Method Input Output Status
PanelBosPegawai private void btnRemove_Click(object sender, EventArgs e)
string idPeg = "0012";
true
Pass
PanelManagerController public bool RemovePegawai(string idPegawai)
string idPeg = "0012"; true Pass
Test Case ID=WMPM004(Remove Pegawai)
Class Method Input Output Status
PanelBosPegawai private void btnRemove_Click(object sender, EventArgs e)
string idPeg = "0013";
false
Pass
PanelManagerController public bool RemovePegawai(string idPegawai)
string idPeg = "0012"; false Pass
Test Case ID=WMPM005(Add Pegawai)
Class Method Input Output Status
PanelBosPegawai private void btnSubmitPeg_Click(object sender, EventArgs e)
string idPeg = "0014"; string idJabPeg = "0000000005"; string namaPeg = "Indra Setyawan"; string alamatPeg = "San Diego"; string telpPeg = "135432232"; string tglMsk = "6-3-2010"; string sourceLoc = "Mandau";
true
Pass
PanelManagerController public bool AddPegawai(string idPeg, string idJabPeg, string namaPeg, string alamatPeg, string telpPeg, string tglMsk, string sourceLoc)
string idPeg = "0014"; string idJabPeg = "0000000005"; string namaPeg = "Indra Setyawan"; string alamatPeg = "San Diego"; string telpPeg = "135432232"; string tglMsk = "6-3-2010"; string sourceLoc = "Mandau";
true Pass
Test Case ID=WMPM006(Add Gaji Pegawai Kontrak)
Class Method Input Output Status
PanelBosPegawai private void btnSubmitPeg_Click(object sender, EventArgs e)
string idPeg = "0005"; bool isPegTetapAfter = true; string tunjanganPeg = "500000"; string tglMsk = "6-1-2010"; string tglAkhir = "6-3-2010";
true
Pass
PanelManagerController public bool AddGajiKontrakPegawai(string idPeg, bool isPegTetapAfter, string tunjanganPeg, string tglMsk, string tglAkhir)
string idPeg = "0005"; bool isPegTetapAfter = true; string tunjanganPeg = "500000"; string tglMsk = "6-1-2010"; string tglAkhir = "6-3-2010";
true Pass
SourceCode Unit Testing:
using WorldMart.Logic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace WorldMart.Test
{
/// <summary>
///This is a test class for PegawaiControllerTest and is intended
///to contain all PegawaiControllerTest Unit Tests
///</summary>
[TestClass()]
public class PegawaiControllerTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
[TestMethod()]
public void AddGajiKontrakPegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPeg = "0005"; // TODO: Initialize to an appropriate value
bool isPegTetapAfter = true; // TODO: Initialize to an appropriate value
string tunjanganPeg = "500000"; // TODO: Initialize to an appropriate value
string tglMsk = "6-1-2010"; // TODO: Initialize to an appropriate value
string tglAkhir = "6-3-2010"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.AddGajiKontrakPegawai(idPeg, isPegTetapAfter, tunjanganPeg, tglMsk, tglAkhir);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
/// <summary>
///A test for AddPegawai
///</summary>
[TestMethod()]
public void AddPegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPeg = "0014"; // TODO: Initialize to an appropriate value
string idJabPeg = "0000000005"; // TODO: Initialize to an appropriate value
string namaPeg = "Indra Setyawan"; // TODO: Initialize to an appropriate value
string alamatPeg = "San Diego"; // TODO: Initialize to an appropriate value
string telpPeg = "135432232"; // TODO: Initialize to an appropriate value
string tglMsk = "6-3-2010"; // TODO: Initialize to an appropriate value
string sourceLoc = "Mandau"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.AddPegawai(idPeg, idJabPeg, namaPeg, alamatPeg, telpPeg, tglMsk, sourceLoc);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for RemovePegawai
///</summary>
[TestMethod()]
public void RemovePegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPegawai ="0012"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.RemovePegawai(idPegawai);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
[TestMethod()]
public void RemovePegawaiSalahTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPegawai = "0013"; // TODO: Initialize to an appropriate value
bool expected = false; // TODO: Initialize to an appropriate value
bool actual;
actual = target.RemovePegawai(idPegawai);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
/// <summary>
///A test for UpdatePegawai
///</summary>
[TestMethod()]
public void UpdatePegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPeg = "0005"; // TODO: Initialize to an appropriate value
string idJabPeg = "0000000005"; // TODO: Initialize to an appropriate value
string namaPeg = "ali"; // TODO: Initialize to an appropriate value
string alamatPeg = "Santa Barbara"; // TODO: Initialize to an appropriate value
string telpPeg = "081321030203"; // TODO: Initialize to an appropriate value
string tglMsk = "6-3-2010"; // TODO: Initialize to an appropriate value
string sourceLoc = "Riau"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.UpdatePegawai(idPeg, idJabPeg, namaPeg, alamatPeg, telpPeg, tglMsk, sourceLoc);
Assert.AreEqual(expected, actual);
}
/// <summary>
///A test for UpdateGajiKontrakPegawai
///</summary>
[TestMethod()]
public void UpdateGajiKontrakPegawaiTest()
{
PegawaiController target = new PegawaiController(); // TODO: Initialize to an appropriate value
string idPeg = "0005"; // TODO: Initialize to an appropriate value
bool isPegTetapBefore = false; // TODO: Initialize to an appropriate value
bool isPegTetapAfter = true; // TODO: Initialize to an appropriate value
string tunjanganPeg = "500000"; // TODO: Initialize to an appropriate value
string tglMsk = "6-3-2010"; // TODO: Initialize to an appropriate value
string tglAkhir ="6-3-2010"; // TODO: Initialize to an appropriate value
bool expected = true; // TODO: Initialize to an appropriate value
bool actual;
actual = target.UpdateGajiKontrakPegawai(idPeg, isPegTetapBefore, isPegTetapAfter, tunjanganPeg, tglMsk, tglAkhir);
Assert.AreEqual(expected, actual);
}
}