private decimal ExtractResponse(OpenFiscaResource openFiscaResponse) { var personKey = openFiscaResponse.persons.First().Key; var dictResult = openFiscaResponse.GetProp(personKey, OF.MaternityBenefitsAmount); return(Convert.ToDecimal(dictResult)); }
public void ShouldFetchKeys() { // Arrange string personKey = "myPersonKey"; string propKey = "myPropKey"; decimal value = 99.23223m; // Act var sut = new OpenFiscaResource(); sut.persons.Add(personKey, new Dictionary <string, Dictionary <string, object> >()); sut.persons[personKey].Add(propKey, new Dictionary <string, object>()); sut.persons[personKey][propKey].Add("dateKey", value); var result = sut.GetProp(personKey, propKey); // Assert Assert.Equal(value, result); }
public void ShouldCreateKeys() { // Arrange string personKey = "myPersonKey"; string propKey = "myPropKey"; decimal value = 99.23223m; // Act var sut = new OpenFiscaResource(); sut.CreatePerson(personKey); sut.SetProp(personKey, propKey, value); // Assert var manualResult = sut.persons[personKey][propKey].First().Value; var getResult = sut.GetProp(personKey, propKey); Assert.Equal(value, manualResult); Assert.Equal(value, getResult); }