public void GetDefault_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new KupahRepository(context); // Act kupah result = repository.GetDefault(); // Assert Assert.IsNotNull(result); Assert.IsTrue((bool)result.isDefault); }
public void GetAll_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new KupahRepository(context); // Act IEnumerable <kupah> result = repository.GetAll(); // Assert Assert.IsNotNull(result); Assert.AreEqual(context.kupah.Count(), result.Count()); }
public void GetDefault_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new KupahRepository(context); var service = new KupahService(repository); // Act KupahModel result = service.GetDefault(); // Assert Assert.IsNotNull(result); Assert.IsTrue(result.IsDefault); }
public void GetById_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new KupahRepository(context); int id = 1; // Act kupah result = repository.GetById(id); // Assert Assert.IsNotNull(result); Assert.AreEqual(id, result.id); }
public void GetById_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new KupahRepository(context); var service = new KupahService(repository); int id = 1; // Act KupahModel result = service.GetById(id); // Assert Assert.IsNotNull(result); Assert.AreEqual(id, result.Id); }
public void GetAllFilterByCurrent_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new KupahRepository(context); var service = new KupahService(repository); // Act IEnumerable <KupahModel> result = service.GetAllFilterByCurrent(); // Assert Assert.IsNotNull(result); Assert.AreEqual(context.kupah.Where(x => x.isCurrent).Count(), result.Count()); Assert.AreEqual(result.Where(x => x.IsCurrent).Count(), result.Count()); }