public void Update_SaveChangesSuccess_UpdatedEntity()
        {
            //Arrange
            var options = new DbContextOptionsBuilder()
                          .UseInMemoryDatabase(databaseName: "UpdateSuccess")
                          .Options;

            using (TemplateContext context = new TemplateContext(options))
            {
                //Act
                Template templateExistente = new Template()
                {
                    Id           = new Guid("7c9e6679-7425-40de-944b-e07fc1f90ae7"),
                    Name         = "Catalogo",
                    Description  = "Catalogo de prueba",
                    AddedDate    = DateTime.Now,
                    ModifiedDate = DateTime.Now,
                    IsActive     = true
                };

                context.Add(templateExistente);
                context.SaveChanges();

                //SUT
                ClassUpdaterRepository SUT = new ClassUpdaterRepository(context);

                var templateActualizado = SUT.Update(templateExistente);

                // Assert
                Assert.Equal(1, templateActualizado);
            }
        }
        public void UpdaterRepository_ContextWithValue_ContextInstance()
        {
            //Arrange
            var options = new DbContextOptionsBuilder()
                          .UseInMemoryDatabase(databaseName: "UpdaterRepository_ContextWithValue_ContextInstance")
                          .Options;

            using (TemplateContext context = new TemplateContext(options))
            {
                //SUT
                var SUT = new ClassUpdaterRepository(context);

                // Assert
                Assert.NotNull(SUT);
            }
        }
        public void Update_SaveChangeFailed_Exception()
        {
            //Arrange
            var options = new DbContextOptionsBuilder()
                          .UseInMemoryDatabase(databaseName: "Update_SaveChangeFailed_Exception")
                          .Options;

            using (TemplateContext context = new TemplateContext(options))
            {
                //SUT
                var      SUT      = new ClassUpdaterRepository(context);
                Template template = new Template();

                SUT.Update(template);
            }

            using (TemplateContext context = new TemplateContext(options))
            {
                int registro_No_actualizado = context.SaveChanges();

                // Assert
                Assert.Equal(0, registro_No_actualizado);
            }
        }