public void TestClear() { //Arrange var fileCabinet = new FileCabinetService(); var expected = new List <Record>(); //Act fileCabinet.Create("firstName", "lastName", "dateOfBirth"); fileCabinet.Clear(); var result = fileCabinet.GetRecords().ToList(); //Assert CollectionAssert.AreEqual(expected, result); }
public void TestGetRecordsCount() { //Arrange var fileCabinet = new FileCabinetService(); const int expected = 2; //Act fileCabinet.Create("firstName", "lastName", "dateOfBirth"); fileCabinet.Create("first", "last", "date"); var result = fileCabinet.GetRecordsCount(); //Assert Assert.AreEqual(expected, result); }
public void TestCreate(string firstName, string lastName, string dateOfBirth) { //Arrange var fileCabinet = new FileCabinetService(); var expected = new List <Record> { new Record { FirstName = firstName, LastName = lastName, DateOfBirth = dateOfBirth } }; //Act fileCabinet.Create(firstName, lastName, dateOfBirth); var result = fileCabinet.GetRecords().ToList(); //Assert CollectionAssert.AreEqual(expected, result); }
public void TestUpdate() { //Arrange var fileCabinet = new FileCabinetService(); var expected = new List <Record> { new Record { FirstName = "first", LastName = "last", DateOfBirth = "date" } }; //Act fileCabinet.Create("firstName", "lastName", "dateOfBirth"); fileCabinet.Update(0, "first", "last", "date"); var result = fileCabinet.GetRecords().ToList(); //Assert CollectionAssert.AreEqual(expected, result); }