Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit dfdc71f

Browse files
committed
something changed
1 parent a3b44e2 commit dfdc71f

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

DataTest/Database1.mdf

0 Bytes
Binary file not shown.

DataTest/Database1_log.ldf

0 Bytes
Binary file not shown.

DataTest/Datatest.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public static String getCtString()
1313
{
1414
string RPath = @"Database1.mdf";
1515
string RootPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName;
16-
string _DBPath = Path.Combine(RootPath, RPath);
17-
return $@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename={_DBPath};Integrated Security = True";
16+
string DatabasePath = Path.Combine(RootPath, RPath);
17+
return $@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename={DatabasePath};Integrated Security = True;";
1818
}
1919

2020

@@ -32,13 +32,15 @@ public void TestUpdate()
3232
{
3333
IDataApi api = IDataApi.createDataRepository(getCtString());
3434
Assert.AreEqual(api.getProductPrice(2), 100);
35+
api.updateProduct(5, "Milk", 5, 5000);
36+
Assert.AreEqual(api.getProductPrice(5), 5);
3537
}
3638

3739
[TestMethod]
3840
public void TestCount()
3941
{
4042
IDataApi api = IDataApi.createDataRepository(getCtString());
41-
Assert.AreEqual(api.getProducts().Count(), 3);
43+
Assert.AreEqual(api.getProducts().Count(), 7);
4244
Assert.AreEqual(api.getEvents().Count(), 1);
4345
}
4446

@@ -48,6 +50,7 @@ public void TestMethodSyntax()
4850
IDataApi api = IDataApi.createDataRepository(getCtString());
4951
Assert.AreEqual(api.getProductPriceMethod(2), 100);
5052
Assert.AreEqual(api.getCustomerFirstNameMethod(2), "John");
53+
5154
}
5255
}
5356
}

0 commit comments

Comments
 (0)