Ejemplo n.º 1
0
            public void Should_Add_Client_Record_ToDb()
            {
                // Arrange
                string pathToFile = @"С:\Users\Dakosia\source\repos\CSharp\KazTourApp\KazTourApp.DAL\LiteDb.db";
                var    client     = new ClientRecord
                                    (
                    1,
                    "Asuna",
                    "Yuuki",
                    "1234567890",
                    "*****@*****.**"
                                    );

                ClientStorage storage = new ClientStorage();
                int           itemsCountBeforeInsert = storage.ReadAllClients().Count;

                // Act
                storage.AddClient(client);

                // Assert
                Assert.IsTrue(File.Exists(pathToFile));

                int itemsCountAfterInsert = storage.ReadAllClients().Count;

                Assert.IsTrue(itemsCountBeforeInsert == itemsCountAfterInsert - 1);
            }
Ejemplo n.º 2
0
 public IActionResult AddClient(Client client)
 {
     return(Ok(_storage.AddClient(client)));
 }