summaryrefslogtreecommitdiff
path: root/src/test/Cmpp298.Assignment3.Test/Task/VendorTaskTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/Cmpp298.Assignment3.Test/Task/VendorTaskTest.cs')
-rw-r--r--src/test/Cmpp298.Assignment3.Test/Task/VendorTaskTest.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/Cmpp298.Assignment3.Test/Task/VendorTaskTest.cs b/src/test/Cmpp298.Assignment3.Test/Task/VendorTaskTest.cs
new file mode 100644
index 0000000..2b76674
--- /dev/null
+++ b/src/test/Cmpp298.Assignment3.Test/Task/VendorTaskTest.cs
@@ -0,0 +1,29 @@
+using System.Collections.Generic;
+using Cmpp298.Assignment3.Dto;
+using Cmpp298.Assignment3.Task;
+using MbUnit.Framework;
+
+namespace Cmpp298.Assignment3.Test {
+ [TestFixture]
+ public class VendorTaskTest {
+ [Test]
+ public void Should_Be_Able_To_Find_Vendor_By_Id( ) {
+ IVendorTask task = CreateSut( );
+ const string vendorId = "1";
+ DisplayVendorNameDto dto = task.FindVendorNameBy( vendorId );
+ Assert.IsTrue( dto.VendorId == vendorId );
+ Assert.IsTrue( dto.VendorName == "US Postal Service" );
+ }
+
+ [Test]
+ public void Should_Be_Able_To_Get_All_Vendor_Names( ) {
+ IVendorTask task = CreateSut( );
+ IList< IDropDownListItem > list = new List< IDropDownListItem >( task.GetAllVendorNames( ) );
+ Assert.IsTrue( list.Count > 0, "Should have at least 1 vendor name but has: " + list.Count );
+ }
+
+ private static IVendorTask CreateSut( ) {
+ return new VendorTask( );
+ }
+ }
+} \ No newline at end of file