Ejemplo n.º 1
0
        public void ObjectsDataFillerTest()
        {
            DataManualFiller df1 = new DataManualFiller();

            dataRepository.DataFiller = df1;
            dataRepository.FillData();
            Assert.AreEqual(1, dataRepository.GetAllClients().Count());
        }
Ejemplo n.º 2
0
        public void ObjectsDataFillerTest()
        {
            DataManualFiller df1 = new DataManualFiller();

            dataRepository.DataFiller = df1;
            dataRepository.FillData();
            Assert.AreEqual(3, dataRepository.GetAllClients().Count());
            Assert.AreEqual(2, dataRepository.GetAllCars().Count());
            Assert.AreEqual(1, dataRepository.GetAllWarehouseItems().Count());
            Assert.AreEqual(1, dataRepository.GetAllFactures().Count());
            Assert.AreEqual(1, dataRepository.GetAllBillesOfSale().Count());
        }
Ejemplo n.º 3
0
        public void JsonSerializationAndDeserlializationTest()
        {
            DataContext dataContext = new DataContext();
            IDataFiller dataFiller  = new DataManualFiller();

            dataFiller.InsertData(dataContext);

            JsonDataSerializer.Serialize(dataContext, pathToFile);

            DataContext deserializedDataContext = JsonDataSerializer.Deserialize <DataContext>(pathToFile);

            CollectionAssert.AreEqual(dataContext.Clients, deserializedDataContext.Clients);
            CollectionAssert.AreEqual(dataContext.Cars, deserializedDataContext.Cars);
            CollectionAssert.AreEqual(dataContext.WarehouseItems, deserializedDataContext.WarehouseItems);

            CollectionAssert.AreEqual(dataContext.BoughtCars, deserializedDataContext.BoughtCars);
            CollectionAssert.AreEqual(dataContext.SoldCars, deserializedDataContext.SoldCars);
        }