public void ThingItemMarketPlaceListingNotesValueNotNull() { CollectionAssert.AllItemsAreNotNull(Return.Items[ReturnID].MarketplaceListing.Select(listing => listing.Notes.value).ToList()); }
public void Game_with_MapList_filled() { CollectionAssert.AllItemsAreNotNull(g.Map); }
public void ItemsMustNotNull() { CollectionAssert.AllItemsAreNotNull(_users); }
public void not_null() { CollectionAssert.AllItemsAreNotNull(_userList); }
public void TestColeccionAlumnos() { Universidad uni = new Universidad(); CollectionAssert.AllItemsAreNotNull(uni.Alumnos); }
public void Nijedan_Test_Nije_Null() { CollectionAssert.AllItemsAreNotNull(testovi, "Postoji test koji je null!"); }
public void ShouldBeAbleToRetrieveAllPortfolioForLoggedInUser() { var allPortfolios = stockExhangeServiceManager.GetAllPortfolios("balram"); CollectionAssert.AllItemsAreNotNull(allPortfolios); }
public void ThingItemStatisticsRatingsRanksBayesAverageNotNull() { CollectionAssert.AllItemsAreNotNull( Return.Items.Select(item => item.Statistics.Rating.Select(ratings => ratings.Ranks.Select(rank => rank.BayesAverage))).ToList()); }
public async void Default_ReturnsValidCollection() { var result = await HaloApiService.GetCampaignMissions(); CollectionAssert.AllItemsAreNotNull(result); }
public void ThingItemStatisticsRatingsAvgWeightNotNull() { CollectionAssert.AllItemsAreNotNull( Return.Items.Select(item => item.Statistics.Rating.Select(ratings => ratings.AverageWeight.value)).ToList()); }
public void ThingItemStatisticsHistoricalDateNotNull() { CollectionAssert.AllItemsAreNotNull( Return.Items.Select(item => item.Statistics.Rating.Select(ratings => ratings.Date)).ToList()); }
public void ThingItemStatisticsRatingsNumCommentsNotNull() { CollectionAssert.AllItemsAreNotNull( Return.Items.Select(item => item.Statistics.Rating.Select(ratings => ratings.NumComments.value)).ToList()); }
public void ThingItemStatisticsRatingsUserRatedNotNull() { CollectionAssert.AllItemsAreNotNull( Return.Items.Select(item => item.Statistics.Rating.Select(ratings => ratings.UsersRated.value)).ToList()); }
public void ThingItemMarketPlaceListingLinkTitleNotNull() { CollectionAssert.AllItemsAreNotNull(Return.Items[ReturnID].MarketplaceListing.Select(listing => listing.Link.Title).ToList()); }
public void GetAllAttachmentsWhichHasToBeNotNull_Test() { var actualAttachments = _controller.GetAllAttachments(); CollectionAssert.AllItemsAreNotNull(actualAttachments); }
public void Check_Pure_Glo_Observations_File_With_StoreMode() { var parser = new RinexObsParser("pure_glo.16o", ParseType.StoreData); parser.Parse(); Assert.IsTrue(parser.RinexType == RinexType.Obs); Assert.IsTrue(parser.ObsHeader.ObsHeaderData.SatelliteSystem == SatelliteSystem.Glo); Assert.IsTrue(parser.ObsHeader.ObsHeaderData.GnssTimeSystem == GnssTimeSystem.Glo); Assert.IsTrue(parser.ObservationRecords.Count == 19); var metaData = parser.ObsHeader.ObsHeaderData.ObsMetaData; CheckObservations(metaData, SatelliteSystem.Glo, new[] { ObservationCode.C1C, ObservationCode.L1C, ObservationCode.D1C, ObservationCode.S1C, ObservationCode.C2P, ObservationCode.L2P, ObservationCode.D2P, ObservationCode.S2P }); var phaseCorrections = parser.ObsHeader.ObsHeaderData.GloPhaseBiasCor; Assert.IsTrue(phaseCorrections.ContainsKey(ObservationCode.C1C)); Assert.IsTrue(Math.Abs(phaseCorrections[ObservationCode.C1C] - -71.940) < Double.Epsilon); Assert.IsTrue(phaseCorrections.ContainsKey(ObservationCode.C1P)); Assert.IsTrue(Math.Abs(phaseCorrections[ObservationCode.C1P] - -71.940) < Double.Epsilon); Assert.IsTrue(phaseCorrections.ContainsKey(ObservationCode.C2C)); Assert.IsTrue(Math.Abs(phaseCorrections[ObservationCode.C2C] - -71.940) < Double.Epsilon); Assert.IsTrue(phaseCorrections.ContainsKey(ObservationCode.C2P)); Assert.IsTrue(Math.Abs(phaseCorrections[ObservationCode.C2P] - -71.940) < Double.Epsilon); var slotFrqKeys = parser.ObsHeader.ObsHeaderData.GloSlotFreqDict.Keys; var slotFrqValues = parser.ObsHeader.ObsHeaderData.GloSlotFreqDict.Values; var expected = new List <GloSatellite>(); var temp = Enum.GetValues(typeof(GloSatellite)); for (var i = 0; i < 24; i++) { expected.Add((GloSatellite)temp.GetValue(i)); } CollectionAssert.AreEqual(expected, slotFrqKeys); CollectionAssert.AreEqual( new[] { 1, -4, 5, 6, 1, -4, 5, 6, -6, -7, 0, -1, -2, -7, 0, -1, 4, -3, 3, 2, 4, -3, 3, 2 }, slotFrqValues); var gloSatData = parser.GetSatellitesObservations <GloSatellite>(); CollectionAssert.AllItemsAreNotNull(gloSatData.Values as ICollection); CollectionAssert.AllItemsAreInstancesOfType(gloSatData.Values.SelectMany(t => t).ToArray(), typeof(SatelliteObs <GloSatellite>)); var observedSatellites = parser.GetObservedSatellites(); Assert.IsTrue(observedSatellites.ContainsKey(SatelliteSystem.Glo)); var galPrns = observedSatellites[SatelliteSystem.Glo]; CollectionAssert.AreEqual(galPrns.SatellitePrn <GloSatellite>().ToList(), new[] { GloSatellite.R01, GloSatellite.R08, GloSatellite.R10, GloSatellite.R11, GloSatellite.R13, GloSatellite.R22, GloSatellite.R23, GloSatellite.R24 }); Assert.IsTrue(gloSatData.Count == 19); foreach (var satData in gloSatData.Values) { Assert.IsTrue(satData.Count == 8 || satData.Count == 7); } }
public async void Default_ReturnsValidCollection() { var result = await HaloApiService.HaloWars2.GetGameObjectCategories(); CollectionAssert.AllItemsAreNotNull(result.ContentItems); }
public void Check_Pure_Gps_Observations_File_With_StoreMode() { var parser = new RinexObsParser("pure_gps.16o", ParseType.StoreData); parser.Parse(); Assert.IsTrue(parser.RinexType == RinexType.Obs); Assert.IsTrue(parser.ObsHeader.ObsHeaderData.SatelliteSystem == SatelliteSystem.Gps); Assert.IsTrue(parser.ObsHeader.ObsHeaderData.GnssTimeSystem == GnssTimeSystem.Gps); Assert.IsTrue(parser.ObservationRecords.Count == 19); var metaData = parser.ObsHeader.ObsHeaderData.ObsMetaData; CheckObservations(metaData, SatelliteSystem.Gps, new[] { ObservationCode.C1C, ObservationCode.L1C, ObservationCode.D1C, ObservationCode.S1C, ObservationCode.C2S, ObservationCode.L2S, ObservationCode.D2S, ObservationCode.S2S, ObservationCode.C2W, ObservationCode.L2W, ObservationCode.D2W, ObservationCode.S2W, ObservationCode.C5Q, ObservationCode.L5Q, ObservationCode.D5Q, ObservationCode.S5Q }); var sysPhaseShift = parser.ObsHeader.ObsHeaderData.PhaseShiftDict; Assert.IsTrue(sysPhaseShift.ContainsKey(SatelliteSystem.Gps)); var temp = sysPhaseShift[SatelliteSystem.Gps].SingleOrDefault(t => t.ObservationCode == ObservationCode.L2S); Assert.IsTrue(temp != null); Assert.IsTrue(temp.ObservationCode == ObservationCode.L2S); Assert.IsTrue(Math.Abs(temp.CorrectionCycles - -0.25) <= Double.Epsilon); temp = sysPhaseShift[SatelliteSystem.Gps].SingleOrDefault(t => t.ObservationCode == ObservationCode.L2X); Assert.IsTrue(temp != null); Assert.IsTrue(temp.ObservationCode == ObservationCode.L2X); Assert.IsTrue(Math.Abs(temp.CorrectionCycles - -0.25) <= Double.Epsilon); var gpsObsData = parser.GetSatellitesObservations <GpsSatellite>(); CollectionAssert.AllItemsAreNotNull(gpsObsData.Values as ICollection); CollectionAssert.AllItemsAreInstancesOfType(gpsObsData.Values.SelectMany(t => t).ToArray(), typeof(SatelliteObs <GpsSatellite>)); var observedSatellites = parser.GetObservedSatellites(); Assert.IsTrue(observedSatellites.ContainsKey(SatelliteSystem.Gps)); var galPrns = observedSatellites[SatelliteSystem.Gps]; CollectionAssert.AreEqual(galPrns.SatellitePrn <GpsSatellite>().ToList(), new[] { GpsSatellite.G05, GpsSatellite.G12, GpsSatellite.G14, GpsSatellite.G15, GpsSatellite.G18, GpsSatellite.G20, GpsSatellite.G21, GpsSatellite.G24, GpsSatellite.G25, GpsSatellite.G29, GpsSatellite.G31, GpsSatellite.G32 }); Assert.IsTrue(gpsObsData.Count == 19); foreach (var satData in gpsObsData.Values) { Assert.IsTrue(satData.Count == 12); } }
public void ShouldReturnAllStocksForGivenPortfolio() { var stocksInPortfolio = stockExhangeServiceManager.GetPortfolioDetails(1); CollectionAssert.AllItemsAreNotNull(stocksInPortfolio); }
private void TestHelper(int level, DataAxis axis, SortOrder sortOrder) { var groups = GetGroupsAtLevel(axis, level); Assert.IsNotNull(groups); Assert.IsTrue(groups.Count > 0); CollectionAssert.AllItemsAreNotNull(groups); CollectionAssert.AllItemsAreUnique(groups); var comparer = new GroupComparerDecorator(this.grandTotalComparer, sortOrder, resultProvider, axis); if (level > 1) { var subGroups = GetGroupsAtLevel(axis, level - 1); foreach (var group in subGroups.OfType <Group>()) { group.SortSubGroups(comparer); IGroup temp = null; foreach (var subGroup in group.Items.OfType <IGroup>()) { if (temp != null) { int result = grandTotalComparer.CompareGroups(resultProvider, temp, subGroup, axis); if (sortOrder == SortOrder.Ascending) { Assert.IsTrue(result <= 0); } else { Assert.IsTrue(result >= 0); } } temp = subGroup; } } } else { groups.Sort(comparer); IGroup temp = null; foreach (var group in groups) { if (temp != null) { int result = grandTotalComparer.CompareGroups(resultProvider, temp, group, axis); if (sortOrder == SortOrder.Ascending) { Assert.IsTrue(result <= 0); } else { Assert.IsTrue(result >= 0); } } temp = group; } } }
public async Task Should_Upload_Attachment() { //read document from specified path string documentPath = "E:\\uploadAttachment.txt"; byte[] documentData = File.ReadAllBytes(documentPath); //upload attachment to redmine Upload attachment = await redmineManager.UploadFileAsync(documentData); //set attachment properties attachment.FileName = "AttachmentUploaded.txt"; attachment.Description = "File uploaded using REST API"; attachment.ContentType = "text/plain"; //create list of attachments to be added to issue IList <Upload> attachments = new List <Upload>(); attachments.Add(attachment); //read document from specified path documentPath = "E:\\uploadAttachment1.txt"; documentData = File.ReadAllBytes(documentPath); //upload attachment to redmine Upload attachment1 = await redmineManager.UploadFileAsync(documentData); //set attachment properties attachment1.FileName = "AttachmentUploaded1.txt"; attachment1.Description = "Second file uploaded"; attachment1.ContentType = "text/plain"; attachments.Add(attachment1); Issue issue = new Issue(); issue.Project = new Project { Id = 10 }; issue.Tracker = new IdentifiableName { Id = 4 }; issue.Status = new IdentifiableName { Id = 5 }; issue.Priority = new IdentifiableName { Id = 8 }; issue.Subject = "Issue with attachments"; issue.Description = "Issue description..."; issue.Category = new IdentifiableName { Id = 11 }; issue.FixedVersion = new IdentifiableName { Id = 9 }; issue.AssignedTo = new IdentifiableName { Id = 8 }; issue.ParentIssue = new IdentifiableName { Id = 19 }; issue.CustomFields = new List <IssueCustomField>(); issue.CustomFields.Add(new IssueCustomField { Id = 13, Values = new List <CustomFieldValue> { new CustomFieldValue { Info = "Issue custom field completed" } } }); issue.IsPrivate = true; issue.EstimatedHours = 12; issue.StartDate = DateTime.Now; issue.DueDate = DateTime.Now.AddMonths(1); issue.Uploads = attachments; issue.Watchers = new List <Watcher>(); issue.Watchers.Add(new Watcher { Id = 8 }); issue.Watchers.Add(new Watcher { Id = 2 }); //create issue and attach document Issue issueWithAttachment = await redmineManager.CreateObjectAsync <Issue>(issue); issue = await redmineManager.GetObjectAsync <Issue>(issueWithAttachment.Id.ToString(), new NameValueCollection { { "include", "attachments" } }); Assert.IsNotNull(issue, "Get issue returned null."); Assert.IsInstanceOfType(issue, typeof(Issue)); Assert.IsTrue(issue.Attachments.Count == 2, "Attachments count != 2"); CollectionAssert.AllItemsAreNotNull(issue.Attachments.ToList(), "Attachments contains null items."); CollectionAssert.AllItemsAreUnique(issue.Attachments.ToList(), "Attachments items are not unique."); Assert.IsTrue(issue.Attachments[0].FileName == attachment.FileName); Assert.IsTrue(issue.Attachments[1].FileName == attachment1.FileName); }
public void BoardGameRequestUserNameNotNull() { CollectionAssert.AllItemsAreNotNull(RatingsReturn.Select(key => key.Value.Select(comment => comment.UserName)).ToList()); }
public void TestColeccionProfesores() { Universidad uni = new Universidad(); CollectionAssert.AllItemsAreNotNull(uni.Instructores); }
public void BoardGameCommentsRatingNotNull() { CollectionAssert.AllItemsAreNotNull(CommentReturn.Select(key => key.Value.Select(comment => comment.Rating)).ToList()); }
public void WhenUserCheckIfAllSecondArticlesArePresent() { RealResults = bll.CheckingSecondHeadersArticleArePresent(); CollectionAssert.AllItemsAreNotNull(RealResults); }
public void Test_DodavanjeSvihUposlenika() { CollectionAssert.AllItemsAreNotNull(fax.dajSveUposlenike()); }
public async void Default_ReturnsValidCollection() { var result = await HaloApiService.GetFlexibleStats(); CollectionAssert.AllItemsAreNotNull(result); }
public void DynamicDeserializationTest() { var h = new Hero(0, 0, 0, null, null); string json; BehaviourAlgorithm algorithm; json = "[{\"type\":\"ShootElement\", \"isActive\":\"true\"}]"; algorithm = DynamicJsonDeserializer.ToBehaviourAlgorithm(json, h); Assert.NotNull(algorithm); CollectionAssert.IsNotEmpty(algorithm.CodeElements); CollectionAssert.AllItemsAreNotNull(algorithm.CodeElements); Assert.AreEqual(1, algorithm.CodeElements.Count); Assert.IsInstanceOf <ShootElement>(algorithm.CodeElements[0]); json = "[{\"type\":\"CodeBlockElement\", \"isActive\":\"true\", \"elements\":[{\"type\":\"ShootElement\", \"isActive\":\"true\"}, {\"type\":\"IdleElement\", \"isActive\":\"true\"}]}]"; algorithm = DynamicJsonDeserializer.ToBehaviourAlgorithm(json, h); Assert.NotNull(algorithm); CollectionAssert.IsNotEmpty(algorithm.CodeElements); CollectionAssert.AllItemsAreNotNull(algorithm.CodeElements); Assert.AreEqual(1, algorithm.CodeElements.Count); Assert.IsInstanceOf <CodeBlockElement>(algorithm.CodeElements[0]); { var block = algorithm.CodeElements[0] as CodeBlockElement; Assert.NotNull(block); Assert.NotNull(block.CodeElements); CollectionAssert.IsNotEmpty(block.CodeElements); CollectionAssert.AllItemsAreNotNull(block.CodeElements); Assert.AreEqual(2, block.CodeElements.Count); Assert.IsInstanceOf <ShootElement>(block.CodeElements.ElementAt(0)); Assert.IsInstanceOf <IdleElement>(block.CodeElements.ElementAt(1)); } json = "[" + "{\"type\":\"ShootElement\", \"isActive\":\"true\"}, " + "{\"type\":\"CodeBlockElement\", \"isActive\":\"true\", \"elements\":[{\"type\":\"ShootElement\", \"isActive\":\"true\"}]}," + "{\"type\":\"BranchingElement\", \"isActive\":\"true\", " + "\"cond\":{\"type\":\"IsEnemyNearCondition\", \"isActive\":\"true\"}, " + "\"then\":{\"type\":\"CodeBlockElement\", \"isActive\":\"true\", \"elements\":[{\"type\":\"ShootElement\", \"isActive\":\"true\"}, {\"type\":\"IdleElement\", \"isActive\":\"true\"}]}, " + "\"else\":{\"type\":\"CodeBlockElement\", \"isActive\":\"true\", \"elements\":[{\"type\":\"ShootElement\", \"isActive\":\"true\"}, {\"type\":\"IdleElement\", \"isActive\":\"true\"}]}" + "}" + "]"; algorithm = DynamicJsonDeserializer.ToBehaviourAlgorithm(json, null); Assert.NotNull(algorithm); CollectionAssert.IsNotEmpty(algorithm.CodeElements); CollectionAssert.AllItemsAreNotNull(algorithm.CodeElements); Assert.AreEqual(3, algorithm.CodeElements.Count); Assert.IsInstanceOf <ShootElement>(algorithm.CodeElements[0]); Assert.IsInstanceOf <CodeBlockElement>(algorithm.CodeElements[1]); { var block = algorithm.CodeElements[1] as CodeBlockElement; Assert.NotNull(block); Assert.NotNull(block.CodeElements); CollectionAssert.IsNotEmpty(block.CodeElements); CollectionAssert.AllItemsAreNotNull(block.CodeElements); Assert.AreEqual(1, block.CodeElements.Count); Assert.IsInstanceOf <ShootElement>(block.CodeElements.First()); } Assert.IsInstanceOf <BranchingElement>(algorithm.CodeElements[2]); { var branching = algorithm.CodeElements[2] as BranchingElement; Assert.NotNull(branching); Assert.NotNull(branching.Condition); Assert.NotNull(branching.ThenBlock); Assert.NotNull(branching.ElseBlock); CollectionAssert.IsNotEmpty(branching.ThenBlock.CodeElements); CollectionAssert.IsNotEmpty(branching.ElseBlock.CodeElements); CollectionAssert.AllItemsAreNotNull(branching.ThenBlock.CodeElements); CollectionAssert.AllItemsAreNotNull(branching.ElseBlock.CodeElements); Assert.AreEqual(2, branching.ThenBlock.CodeElements.Count); Assert.AreEqual(2, branching.ElseBlock.CodeElements.Count); Assert.IsInstanceOf <IsEnemyNearCondition>(branching.Condition); Assert.IsInstanceOf <ShootElement>(branching.ThenBlock.CodeElements.ElementAt(0)); Assert.IsInstanceOf <IdleElement>(branching.ThenBlock.CodeElements.ElementAt(1)); Assert.IsInstanceOf <ShootElement>(branching.ElseBlock.CodeElements.ElementAt(0)); Assert.IsInstanceOf <IdleElement>(branching.ElseBlock.CodeElements.ElementAt(1)); } }
public void ItemsNotNull() { var collection = new SimpleObjectCollection("x", "y", "z"); CollectionAssert.AllItemsAreNotNull(collection); }
public void ThingItemMarketPlaceListingPriceCurrencyNotNull() { CollectionAssert.AllItemsAreNotNull(Return.Items[ReturnID].MarketplaceListing.Select(listing => listing.Price.Currency).ToList()); }