Ejemplo n.º 1
0
        public void PutBusinessModelGroupShouldUpdateModel(int groupId)
        {
            var emails = new List <string>()
            {
                "*****@*****.**"
            };
            var expectedModel = BusinessTestHelper.CreateBusinessModelGroup(1, "updatedName", emails);

            expectedModel.Id = groupId;
            var result          = _buisness.PutBusinessModelGroup(expectedModel);
            var actualGroup     = _data.SelectGroupById(groupId);
            var actualConsumers = _data.SelectConsumersByGroupId(groupId) as List <MailConsumer>;
            var actualModel     = new BusinessModelGroup(actualConsumers, actualGroup);

            Assert.IsTrue(result);
            BusinessTestHelper.CompareBusinessModelGroup(expectedModel, actualModel);
        }
Ejemplo n.º 2
0
        public void SaveBusinessModelGroupShouldSaveModel()
        {
            var emails = new List <string>()
            {
                "*****@*****.**"
            };
            var expectedModel = BusinessTestHelper.CreateBusinessModelGroup(1, "insertedName", emails);
            var modelId       = _buisness.SaveBusinessModelGroup(expectedModel);

            expectedModel.Id = modelId;
            var actualGroup     = _data.SelectGroupById(modelId);
            var actualConsumers = _data.SelectConsumersByGroupId(actualGroup.Id);
            var actualModel     = new BusinessModelGroup(actualConsumers, actualGroup);

            Assert.AreNotEqual(-1, modelId);
            BusinessTestHelper.CompareBusinessModelGroup(expectedModel, actualModel);
        }