public void ParseSingleShardIntoList_EmptyList_Return1TeamData() { sut = new InfluxdbShardParser(); List <EnvTeamDataStorage> result = new List <EnvTeamDataStorage>(); var listoflist = new List <ICollection <decimal> >(); var listInList = new List <decimal>(); decimal time = 0; decimal d = Decimal.Parse("3.4444973985e+11", System.Globalization.NumberStyles.Float); listInList.Add(time); listInList.Add(d); listoflist.Add(listInList); InfluxdbShardTeamData arg = new InfluxdbShardTeamData { tags = new Tag { database = "Team1", env = "Prod-1" }, values = listoflist }; expectedTeamDataList = new List <EnvTeamDataStorage> { new EnvTeamDataStorage { team = "Team1", env = "Prod-1", value = Decimal.ToInt64(d) } }; //ACT result.Add(sut.ParseShardDataIntoEnvTeamDataStorage(arg)); //ASSERT //Assert.Equal(expectedTeamDataList, result); AreSameLists(expectedTeamDataList, result); }
public void ParseSingleShardIntoList_NonEmptyList_Return3TeamData() { //ARRANGE sut = new InfluxdbShardParser(); List <EnvTeamDataStorage> result = new List <EnvTeamDataStorage>(); /*Add preexisting entries */ result.Add(new EnvTeamDataStorage { team = "Team2", env = "Prod-7", value = 23145 }); result.Add(new EnvTeamDataStorage { team = "Team3", env = "Prod-8", value = 4999999 }); var listoflist = new List <ICollection <decimal> >(); var listInList = new List <decimal>(); decimal time = 0; decimal d = Decimal.Parse("8.4444973985e+11", System.Globalization.NumberStyles.Float); listInList.Add(time); listInList.Add(d); listoflist.Add(listInList); InfluxdbShardTeamData arg = new InfluxdbShardTeamData { tags = new Tag { database = "Team56", env = "Prod-1" }, values = listoflist }; expectedTeamDataList = new List <EnvTeamDataStorage> { new EnvTeamDataStorage { team = "Team56", env = "Prod-1", value = Decimal.ToInt64(d) }, new EnvTeamDataStorage { team = "Team2", env = "Prod-7", value = 23145 }, new EnvTeamDataStorage { team = "Team3", env = "Prod-8", value = 4999999 } }; //ACT result.Add(sut.ParseShardDataIntoEnvTeamDataStorage(arg)); //ASSERT //Assert.Equal(expectedTeamDataList, result); AreSameLists(expectedTeamDataList, result); }