예제 #1
0
        public void Delete_DeleteSecondCreatedBrand_ShouldReturnTrue()
        {
            //Arrange
            BrandCollection brandCollection = new BrandCollection(new BrandTestDAL());
            Brand           brand0          = new Brand()
            {
                Id     = 0,
                Name   = "TestNameGet1",
                Origin = "TestOriginGet1"
            };
            Brand brand1 = new Brand()
            {
                Id     = 1,
                Name   = "TestNameGet2",
                Origin = "TestOriginGet2"
            };

            brandCollection.Create(brand0);
            brandCollection.Create(brand1);

            bool expected = true;

            //Act
            bool actual = brandCollection.Delete(1);

            //Assert
            Assert.AreEqual(actual, expected);
        }
예제 #2
0
        public void Delete_DeletingNonExistingBrand_ShouldReturnFalse()
        {
            //Arrange
            BrandCollection brandCollection = new BrandCollection(new BrandTestDAL());
            Brand           brand0          = new Brand()
            {
                Id     = 0,
                Name   = "TestNameGet1",
                Origin = "TestOriginGet1"
            };

            brandCollection.Create(brand0);

            bool expected = false;

            //Act
            bool actual = brandCollection.Delete(3);

            //Assert
            Assert.AreEqual(actual, expected);
        }