private decimal ExtractResponse(OpenFiscaResource openFiscaResponse)
        {
            var personKey  = openFiscaResponse.persons.First().Key;
            var dictResult = openFiscaResponse.GetProp(personKey, OF.MaternityBenefitsAmount);

            return(Convert.ToDecimal(dictResult));
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }