Esempio n. 1
0
        public async Task TestPcPartsGetById()
        {
            // arrange
            var repo = new PcPartRepository(_context, _mapper);

            // act
            var result = await repo.GetById(1);

            // assert
            Assert.Equal(MockData.StandardPcPart.Name, result.Name);
        }
Esempio n. 2
0
        public async void TestPcPartUpdatePcPart()
        {
            // arrange
            var repo = new PcPartRepository(_context, _mapper);
            // expected
            var expectedPartName = MockData.StandardPcPart.Name;

            // act
            var result = await repo.Update(await repo.GetById(1));

            // assert
            Assert.Equal(expectedPartName, result.Name);
        }
Esempio n. 3
0
        public async void TestPcPartAddPcPart()
        {
            // arrange
            var repo = new PcPartRepository(_context, _mapper);
            // expected
            var PartToAdd = await repo.GetById(1);

            PartToAdd.Name = "GeForce GTX 2090 Ti";

            // act
            var result = await repo.Add(PartToAdd);

            // assert
            Assert.Equal(PartToAdd.Name, result.Name);
        }