public void ResidentSupportAnnexPatchShouldHaveCorrectProperties() { Type type = typeof(ResidentSupportAnnexPatch); type.GetProperties().Length.Should().Be(20); ResidentSupportAnnexPatch _classUnderTest = new ResidentSupportAnnexPatch { IsDuplicate = "FALSE", FirstName = "Test", LastName = "Test", OngoingFoodNeed = true, Postcode = "test", Uprn = "test", AddressFirstLine = "test", AddressSecondLine = "test", AddressThirdLine = "test", EmailAddress = "test", DobDay = "01", DobMonth = "02", DobYear = "1992", ContactTelephoneNumber = "123", ContactMobileNumber = "123", NumberOfPeopleInHouse = "1", LastConfirmedFoodDelivery = DateTime.Now, RecordStatus = "MASTER", DeliveryNotes = "Test", CaseNotes = "Test" }; Assert.That(_classUnderTest, Has.Property("IsDuplicate").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("FirstName").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("LastName").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("OngoingFoodNeed").InstanceOf(typeof(bool))); Assert.That(_classUnderTest, Has.Property("DobDay").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("DobMonth").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("DobYear").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("ContactTelephoneNumber").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("ContactMobileNumber").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("NumberOfPeopleInHouse").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("LastConfirmedFoodDelivery").InstanceOf(typeof(DateTime))); Assert.That(_classUnderTest, Has.Property("RecordStatus").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("DeliveryNotes").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("CaseNotes").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("Postcode").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("Uprn").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("AddressFirstLine").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("AddressSecondLine").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("AddressThirdLine").InstanceOf(typeof(string))); Assert.That(_classUnderTest, Has.Property("EmailAddress").InstanceOf(typeof(string))); }
public void PatchHelpRequest(int id, ResidentSupportAnnexPatch dataItems) { LambdaLogger.Log("Updating record " + id + " with: " + JsonConvert.SerializeObject(dataItems)); var rec = _dbContext.ResidentSupportAnnex.SingleOrDefault(x => x.Id == id); if (dataItems.OngoingFoodNeed != null) { rec.OngoingFoodNeed = dataItems.OngoingFoodNeed; } if (dataItems.NumberOfPeopleInHouse != null) { rec.NumberOfPeopleInHouse = dataItems.NumberOfPeopleInHouse; } if (dataItems.Postcode != null) { rec.Postcode = dataItems.Postcode; } if (dataItems.Uprn != null) { rec.Uprn = dataItems.Uprn; } if (dataItems.AddressFirstLine != null) { rec.AddressFirstLine = dataItems.AddressFirstLine; } if (dataItems.AddressSecondLine != null) { rec.AddressSecondLine = dataItems.AddressSecondLine; } if (dataItems.AddressThirdLine != null) { rec.AddressThirdLine = dataItems.AddressThirdLine; } if (dataItems.EmailAddress != null) { rec.EmailAddress = dataItems.EmailAddress; } if (dataItems.LastConfirmedFoodDelivery != null) { rec.LastConfirmedFoodDelivery = dataItems.LastConfirmedFoodDelivery; } if (dataItems.IsDuplicate != null) { rec.IsDuplicate = dataItems.IsDuplicate; } if (dataItems.DobDay != null) { rec.DobDay = dataItems.DobDay; } if (dataItems.DobMonth != null) { rec.DobMonth = dataItems.DobMonth; } if (dataItems.DobYear != null) { rec.DobYear = dataItems.DobYear; } if (dataItems.ContactTelephoneNumber != null) { rec.ContactTelephoneNumber = dataItems.ContactTelephoneNumber; } if (dataItems.ContactMobileNumber != null) { rec.ContactMobileNumber = dataItems.ContactMobileNumber; } if (dataItems.RecordStatus != null) { rec.RecordStatus = dataItems.RecordStatus; } if (dataItems.FirstName != null) { rec.FirstName = dataItems.FirstName; } if (dataItems.LastName != null) { rec.LastName = dataItems.LastName; } if (dataItems.DeliveryNotes != null) { rec.DeliveryNotes = dataItems.DeliveryNotes; } if (dataItems.CaseNotes != null) { rec.CaseNotes = dataItems.CaseNotes; } _dbContext.SaveChanges(); }
public void PatchHelpRequest(int id, ResidentSupportAnnexPatch data_items) { _iNeedHelpGateway.PatchHelpRequest(id, data_items); }