public void InvalidateGetObjectData() { // Get Values from XML node. string location = _utilityObj._xmlUtil.GetTextValue( Constants.LocationWithDotOperatorNode, Constants.Location); StreamingContext context = new StreamingContext(StreamingContextStates.All); // Build a location. ILocationBuilder locBuilder = new LocationBuilder(); ILocation loc = locBuilder.GetLocation(location); try { loc.GetObjectData(null, context); Assert.Fail(); } catch (ArgumentNullException) { Console.WriteLine( "GenBankFeatures P1 : Validated the expected exception"); ApplicationLog.WriteLine( "GenBankFeatures P1 : Validated the expected exception"); } }
public void BuildWalls(Location location) { if (location.GetWalls() == null) { Debug.LogWarning("Location's wall is null"); return; } List <string> walls = new List <string>(); float maxx = 0; float maxy = 0; for (int i = 0; i < location.GetWalls().Count; i++) { //find the maximum x (aka the width) if (location.GetWalls()[i].x > maxx) { maxx = location.GetWalls()[i].x; } //find the maximum y (aka the height) if (location.GetWalls()[i].y > maxy) { maxy = location.GetWalls()[i].y; } string coordinate = location.GetWalls()[i].x + "," + location.GetWalls()[i].y; walls.Add(coordinate); } width = maxx; height = maxy; FindObjectOfType <Navigation.Grid>().roomscale = new Vector2(width, height); FindObjectOfType <Navigation.Grid>().GenerateCells(); LocationBuilder.BuildWalls(walls); }
public void GenerateSingleLocationString(double latitude, double longitude) { var result = new LocationBuilder().Append(new GeoLocation(latitude, longitude)) .Build(); Assert.NotEmpty(result); }
void OnDestroy() { if (instance == this) { instance = null; } }
public void ShouldMapLocationToLocationListItemModel() { var entity = new LocationBuilder().Build(); var model = new LocationToLocationListItemModelMapper().Build(entity); model.Classroom.ShouldBe(entity.ClassroomIdentificationCode); }
public void InValidateGenBankLocations() { // Build a location with invalid values ILocationBuilder locBuilder = new LocationBuilder(); ILocation loc = null; try { loc = locBuilder.GetLocation(null); Assert.Fail(); } catch (ArgumentNullException) { Assert.IsNull(loc); ApplicationLog.WriteLine( "GenBankFeatures P2 : Validated the expected exception"); } try { loc = locBuilder.GetLocation("Invalid"); Assert.Fail(); } catch (ArgumentException) { Assert.IsNull(loc); ApplicationLog.WriteLine( "GenBankFeatures P2 : Validated the expected exception"); } }
public static void BuildWalls(List <Vector2> walls) { instance = INSTANCE; DestroyWalls(); GameObject next_wall; Vector3 nextPosition = new Vector3(walls[0].x, 0, walls[0].y); for (int i = 0; i < walls.Count - 1; i++) { next_wall = Instantiate(p_wall, instance.transform.Find("Walls")); next_wall.name = "Wall (" + i + ")"; next_wall.transform.position = nextPosition; nextPosition.x = walls[i + 1].x; nextPosition.z = walls[i + 1].y; next_wall.transform.LookAt(nextPosition); next_wall.transform.localScale = new Vector3(s_wallWidth, s_wallHeight, (nextPosition - next_wall.transform.position).magnitude + (s_wallWidth / 2)); } next_wall = Instantiate(p_wall, instance.transform.Find("Walls")); next_wall.name = "Wall (" + (walls.Count - 1) + ")"; next_wall.transform.position = nextPosition; nextPosition.x = walls[0].x; nextPosition.z = walls[0].y; next_wall.transform.LookAt(nextPosition); next_wall.transform.localScale = new Vector3(s_wallWidth, s_wallHeight, (nextPosition - next_wall.transform.position).magnitude + (s_wallWidth / 2)); }
void Awake() { if (instance != null) { DestroyImmediate(gameObject); } instance = this; }
public void LocationBuilder_ShouldThrowException_When_AddressIsEmpty(string address) { Assert.Throws <ArgumentNullException>(() => { var result = new LocationBuilder().Append(address) .Build(); }); }
public void InValidateGenBankLocationPositions() { // Get Values from XML node. string location = utilityObj.xmlUtil.GetTextValue( Constants.LocationWithEndDataUsingOperatorNode, Constants.Location); string expectedEndData = utilityObj.xmlUtil.GetTextValue( Constants.LocationWithEndDataUsingOperatorNode, Constants.EndData); string expectedStartData = utilityObj.xmlUtil.GetTextValue( Constants.LocationWithEndDataUsingOperatorNode, Constants.StartData); string position = utilityObj.xmlUtil.GetTextValue( Constants.LocationWithEndDataUsingOperatorNode, Constants.Position); // Build a location. ILocationBuilder locBuilder = new LocationBuilder(); Location loc = (Location)locBuilder.GetLocation(location); loc.Resolver = null; loc.EndData = expectedEndData; loc.StartData = expectedStartData; // Validate whether mentioned end data is present in the location // or not. try { loc.IsInEnd(Int32.Parse(position, (IFormatProvider)null)); Assert.Fail(); } catch (InvalidOperationException) { // Log to VSTest GUI. ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "GenBankFeatures P2 : Expected exception is verified")); } try { loc.IsInStart(Int32.Parse(position, (IFormatProvider)null)); Assert.Fail(); } catch (InvalidOperationException) { // Log to VSTest GUI. ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "GenBankFeatures P2 : Expected exception is verified")); } try { loc.IsInRange(Int32.Parse(position, (IFormatProvider)null)); Assert.Fail(); } catch (InvalidOperationException) { // Log to VSTest GUI. ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "GenBankFeatures P2 : Expected exception is verified")); } }
public FakeItemsRepository() { Items = new List <Item>(); for (int i = 0; i < 30; i++) { var location = LocationBuilder.TypicalWId().Build(); var item = ItemBuilder.TypicalWId().WithLocation(location).Build(); Items.Add(item); } }
static void DestroyWalls() { instance = INSTANCE; Transform walls = instance.transform.Find("Walls"); for (int i = walls.childCount - 1; i >= 0; i--) { Destroy(walls.GetChild(i).gameObject); } }
static void DestroyBeacons() { instance = INSTANCE; Transform beacons = instance.transform.Find("Beacons"); for (int i = beacons.childCount - 1; i >= 0; i--) { Destroy(beacons.GetChild(i).gameObject); } }
public static Location ValidateLocation(dynamic data) { Location location = LocationBuilder.Init() .WithName(JsonConvert.SerializeObject(data.name)) .OfType(JsonConvert.SerializeObject(data.type)) .FromDimension(JsonConvert.SerializeObject(data.dimension)) .WithThatManyResidents((ushort)data.residents.Length) .Build(); return(location); }
public void ShouldHaveErrorsWhenLocationExists() { Setup(); var locationEntity = new LocationBuilder().Build(); _genericRepository .Get(Arg.Any <Expression <Func <Web.Data.Entities.Location, bool> > >()) .Returns(locationEntity); _validator.ShouldHaveValidationErrorFor(m => m.ClassroomIdentificationCode, _locationCreateModel.ClassroomIdentificationCode); }
public override void OnInspectorGUI() { //base.OnInspectorGUI(); DrawDefaultInspector(); LocationBuilder myScript = (LocationBuilder)target; if (GUILayout.Button("Build Location")) { myScript.BuildLocation(); } }
public void InValidateSubSequenceWithInvalidAccessionID() { // Get Values from XML node. string sequence = utilityObj.xmlUtil.GetTextValue( Constants.LocationWithDotOperatorNode, Constants.ExpectedSequence); string location = utilityObj.xmlUtil.GetTextValue( Constants.LocationWithDotOperatorNode, Constants.Location); string alphabet = utilityObj.xmlUtil.GetTextValue( Constants.LocationWithDotOperatorNode, Constants.AlphabetNameNode); // Create a sequence object. ISequence seqObj = new Sequence(Utility.GetAlphabet(alphabet), sequence); // Build a location. ILocationBuilder locBuilder = new LocationBuilder(); ILocation loc = locBuilder.GetLocation(location); loc.Accession = "Invalid"; // Get sequence using location of the sequence with operator. try { loc.GetSubSequence(seqObj); Assert.Fail(); } catch (ArgumentException) { ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "GenBankFeatures P2 : Validate the exception successfully")); Console.WriteLine(string.Format((IFormatProvider)null, "GenBankFeatures P2 : Validate the exception successfully")); } Dictionary <string, ISequence> refSeq = null; // Validate GetSubSequence method with null location. try { loc.GetSubSequence(null, refSeq); Assert.Fail(); } catch (ArgumentNullException) { ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "GenBankFeatures P2 : Validate the exception successfully")); Console.WriteLine(string.Format((IFormatProvider)null, "GenBankFeatures P2 : Validate the exception successfully")); } }
public async System.Threading.Tasks.Task Should_CreateWedding() { var defaultLocation = LocationBuilder.WithDefaults(); var dto = new CreateWedding.Request(1, DateTime.UtcNow, defaultLocation.Longitude, defaultLocation.Latitude); var client = _fixture.CreateClient(); var response = await client.PostAsAsync <dynamic, CreateWedding.Response>(Endpoints.Post.CreateWedding, dto); Assert.NotNull(response); }
public void LocationCreatedByBuilderHasCountyGiveToBuilder(string houseNameNumber, string address1, string address2, string county, string city, string postcode) { var location = new LocationBuilder() .WithHouseNameNumber(houseNameNumber) .WithAddressLine1(address1) .WithAddressLine2(address2) .WithCounty(county) .WithCity(city) .WithPostcode(postcode); location.CreateGbpAddress().County.Should().Be(county); }
public void GenerateMultipleDestinationLocations_CheckCountOfDelimiters() { var result = new LocationBuilder().Append(new GeoLocation(80.123456, 80.123456)) .Append(new GeoLocation(80.123456, 80.123456)) .Append(new GeoLocation(80.123456, 80.123456)) .Build(); Assert.NotEmpty(result); var len = result.Split('|').Length; Assert.True(len == 3); }
private static ImmutableArray <LocationFactory> CreateLocationFactories(SourceText source, ImmutableArray <Action <LocationBuilder> > locations) { return(locations.Select(location => { return new LocationFactory(CreateLocation); Location CreateLocation(SyntaxTree syntaxTree) { var builder = new LocationBuilder(source); location.Invoke(builder); return builder.Build(syntaxTree); } }).ToImmutableArray()); }
//x = posx, y = posz, z = roty public static void BuildBeacons(List <Vector3> beacons) { instance = INSTANCE; DestroyBeacons(); GameObject nextBeacon; for (int i = 0; i < beacons.Count; i++) { nextBeacon = Instantiate(p_beacon, instance.transform.Find("Beacons")); nextBeacon.name = "Beacon (" + i + ")"; nextBeacon.transform.position = new Vector3(beacons[i].x, s_beaconHeight, beacons[i].y); nextBeacon.transform.rotation = Quaternion.Euler(0, beacons[i].z, 0); nextBeacon.transform.localScale = new Vector3(s_beaconScale, s_beaconScale, s_beaconScale); } }
//[0] = id, [1] = posx, [2] = posz, [3] = roty public static void BuildBeacons(List <string[]> beacons) { instance = INSTANCE; DestroyBeacons(); GameObject nextBeacon; for (int i = 0; i < beacons.Count; i++) { nextBeacon = Instantiate(p_beacon, instance.transform.Find("Beacons")); nextBeacon.name = "Beacon_" + beacons[i][0]; nextBeacon.transform.position = new Vector3(float.Parse(beacons[i][1]), s_beaconHeight, float.Parse(beacons[i][2])); nextBeacon.transform.rotation = Quaternion.Euler(0, float.Parse(beacons[i][3]), 0); nextBeacon.transform.localScale = new Vector3(s_beaconScale, s_beaconScale, s_beaconScale); nextBeacon.GetComponent <BeaconVisual>().SetInfo(beacons[i][0]); } }
public void BuildBeacons(Location location) { if (location.GetBeacons() == null) { Debug.Log("Locations's Beacons are null."); return; } List <string> beacons = new List <string>(); for (int i = 0; i < location.GetBeacons().Count; i++) { Beacon beacon = location.GetBeacons()[i]; string format = beacon.id + "," + beacon.x + "," + beacon.y + "," + beacon.orientation; beacons.Add(format); } LocationBuilder.BuildBeacons(beacons); }
/// <summary> /// InValidate GenBank location with invalid Start location data. /// <param name="endData">Start data used for different test cases.</param> /// </summary> private static void InValidateLocationStartData(string startData) { // Build a location. LocationResolver locResolver = new LocationResolver(); string location = "123.125"; ILocationBuilder locBuilder = new LocationBuilder(); ILocation loc = locBuilder.GetLocation(location); // Set Invalid end data Validate GetStart method exception. loc.StartData = startData; try { locResolver.IsInStart(loc, 124); Assert.Fail(); } catch (Exception) { LogExceptionMessage(); } }
public void Context() { var country = new CountryBuilder().Build(); UnitOfWork.Save(country); var cinema = new CinemaBuilder().Build(); UnitOfWork.Save(cinema); _film = new FilmBuilder().Build(); UnitOfWork.Save(_film); var location = new LocationBuilder() .WithCountry(country) .WithLocationFilms(new LocationFilmArgs { Film = _film, Cinemas = new[] { new LocationFilmCinemaArgs { Cinema = cinema } } }) .Build(); UnitOfWork.Save(location); UnitOfWork.Clear(); var locationFilmId = location.Films.Single().Id; _filmRatingDto = UnitOfWork.Session.QueryOver <LocationFilmDto>() .Where(x => x.Id == locationFilmId) .List().Single() .Ratings.SingleOrDefault(); }
// Use this for initialization void Start() { List <string> walls = new List <string>(); walls.Add("0.432, 0.000"); walls.Add("0.432, 1.618"); walls.Add("0.000, 1.618"); walls.Add("0.000, 9.179"); walls.Add("0.432, 9.179"); walls.Add("0.432, 9.462"); walls.Add("8.989, 9.462"); walls.Add("8.989, 0.000"); LocationBuilder.BuildWalls(walls); List <string> beacons = new List <string>(); beacons.Add("beacon_1, 3.137, 0.000, 000"); beacons.Add("beacon_2, 1.091, 9.462, 180"); beacons.Add("beacon_3, 8.989, 1.946, 270"); beacons.Add("beacon_4, 8.989, 7.290, 270"); beacons.Add("beacon_5, 3.037, 9.462, 180"); beacons.Add("beacon_6, 0.000, 7.477, 090"); beacons.Add("beacon_7, 0.000, 5.632, 090"); beacons.Add("beacon_8, 0.000, 1.838, 090"); LocationBuilder.BuildBeacons(beacons); List <string> datapoints = new List <string>(); datapoints.Add("0,0,0,0,clo1"); datapoints.Add("5,1,0,90,clo1,clo2,clo3,clo4"); datapoints.Add("10,2,5,15,clo1,clo3,clo5"); datapoints.Add("20,5,5,90,clo1,clo2,clo4"); datapoints.Add("30,6,2,270,clo3,clo5,clo7"); datapoints.Add("40,4,3,15,clo5,clo7,clo9"); datapoints.Add("50,7,5,15,clo0"); DataBuilder.INSTANCE.BuildData(datapoints); }
public void TestLocationBuilder() { string location = "123"; string result = string.Empty; ILocationBuilder locBuilder = new LocationBuilder(); ILocation loc = locBuilder.GetLocation(location); Assert.AreEqual(123, loc.Start); Assert.AreEqual(123, loc.End); Assert.IsTrue(string.IsNullOrEmpty(loc.Separator)); Assert.AreEqual(LocationOperator.None, loc.Operator); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "123.125"; loc = locBuilder.GetLocation(location); Assert.AreEqual(123, loc.Start); Assert.AreEqual(125, loc.End); Assert.AreEqual(".", loc.Separator); Assert.AreEqual(LocationOperator.None, loc.Operator); Assert.AreEqual(0, loc.SubLocations.Count); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "123^125"; loc = locBuilder.GetLocation(location); Assert.AreEqual(123, loc.Start); Assert.AreEqual(125, loc.End); Assert.AreEqual("^", loc.Separator); Assert.AreEqual(LocationOperator.None, loc.Operator); Assert.AreEqual(0, loc.SubLocations.Count); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "123..125"; loc = locBuilder.GetLocation(location); Assert.AreEqual(123, loc.Start); Assert.AreEqual(125, loc.End); Assert.AreEqual("..", loc.Separator); Assert.AreEqual(LocationOperator.None, loc.Operator); Assert.AreEqual(0, loc.SubLocations.Count); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "complement(123..125)"; loc = locBuilder.GetLocation(location); Assert.AreEqual(123, loc.Start); Assert.AreEqual(125, loc.End); Assert.IsTrue(string.IsNullOrEmpty(loc.Separator)); Assert.AreEqual(LocationOperator.Complement, loc.Operator); Assert.AreEqual(1, loc.SubLocations.Count); Assert.AreEqual(123, loc.SubLocations[0].Start); Assert.AreEqual(125, loc.SubLocations[0].End); Assert.AreEqual("..", loc.SubLocations[0].Separator); Assert.AreEqual(LocationOperator.None, loc.SubLocations[0].Operator); Assert.AreEqual(0, loc.SubLocations[0].SubLocations.Count); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "join(complement(123..125),200..300)"; loc = locBuilder.GetLocation(location); Assert.AreEqual(123, loc.Start); Assert.AreEqual(300, loc.End); Assert.IsTrue(string.IsNullOrEmpty(loc.Separator)); Assert.AreEqual(LocationOperator.Join, loc.Operator); Assert.AreEqual(2, loc.SubLocations.Count); Assert.AreEqual(123, loc.SubLocations[0].Start); Assert.AreEqual(125, loc.SubLocations[0].End); Assert.IsTrue(string.IsNullOrEmpty(loc.SubLocations[0].Separator)); Assert.AreEqual(LocationOperator.Complement, loc.SubLocations[0].Operator); Assert.AreEqual(1, loc.SubLocations[0].SubLocations.Count); Assert.AreEqual(200, loc.SubLocations[1].Start); Assert.AreEqual(300, loc.SubLocations[1].End); Assert.AreEqual("..", loc.SubLocations[1].Separator); Assert.AreEqual(LocationOperator.None, loc.SubLocations[1].Operator); Assert.AreEqual(0, loc.SubLocations[1].SubLocations.Count); List <ILocation> leafLocs = loc.GetLeafLocations(); Assert.AreEqual(2, leafLocs.Count); Assert.AreEqual(123, leafLocs[0].Start); Assert.AreEqual(125, leafLocs[0].End); Assert.AreEqual(200, leafLocs[1].Start); Assert.AreEqual(300, leafLocs[1].End); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "join(complement(123..125),complement(200..300))"; loc = locBuilder.GetLocation(location); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "join(complement(123),complement(200..300))"; loc = locBuilder.GetLocation(location); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "complement(join(123..125,200..300))"; loc = locBuilder.GetLocation(location); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "order(123..125,200..300)"; loc = locBuilder.GetLocation(location); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); location = "complement(join(<123..125,200..>300))"; loc = locBuilder.GetLocation(location); result = locBuilder.GetLocationString(loc); Assert.AreEqual(location, result); }
public void LocationBuilderCreatesNldAddressInstance() { var location = new LocationBuilder(); location.CreateNldAddress().Should().BeOfType <NldAddress>(); }
public void GenBankMetadataClone() { LocationBuilder locBuilder = new LocationBuilder(); GenBankMetadata metadata = new GenBankMetadata(); metadata.Accession = new GenBankAccession(); metadata.Accession.Primary = "PAccession"; metadata.Accession.Secondary.Add("SAccession1"); metadata.Accession.Secondary.Add("SAccession2"); metadata.BaseCount = "a 1 c 2"; metadata.Comments.Add("Comment1"); metadata.Comments.Add("Comment2"); metadata.Contig = "Contig Info"; metadata.DBLink = new CrossReferenceLink(); metadata.DBLink.Type = CrossReferenceType.Project; metadata.DBLink.Numbers.Add("100"); metadata.DBLink.Numbers.Add("200"); metadata.DBSource = "DbSourceInfo"; metadata.Definition = "Defination info"; metadata.Features = new SequenceFeatures(); FeatureItem feature = new FeatureItem("feature1", "1"); List <string> qualifierValues = new List <string>(); qualifierValues.Add("qualifier1value1"); qualifierValues.Add("qualifier1value2"); feature.Qualifiers.Add("qualifier1", qualifierValues); metadata.Features.All.Add(feature); feature = new FeatureItem("feature2", "2"); qualifierValues = new List <string>(); qualifierValues.Add("qualifier2value1"); qualifierValues.Add("qualifier2value2"); feature.Qualifiers.Add("qualifier2", qualifierValues); metadata.Features.All.Add(feature); feature = new FeatureItem("feature2", "2"); qualifierValues = new List <string>(); qualifierValues.Add("qualifier2value1"); qualifierValues.Add("qualifier2value2"); feature.Qualifiers.Add("qualifier2", qualifierValues); metadata.Features.All.Add(feature); metadata.Keywords = "keywords data"; metadata.Locus = new GenBankLocusInfo(); metadata.Locus.Date = DateTime.Now; metadata.Locus.DivisionCode = SequenceDivisionCode.CON; metadata.Locus.MoleculeType = MoleculeType.DNA; metadata.Locus.Name = "LocusName"; metadata.Locus.SequenceLength = 100; metadata.Locus.SequenceType = "bp"; metadata.Locus.Strand = SequenceStrandType.Double; metadata.Locus.StrandTopology = SequenceStrandTopology.Linear; metadata.Origin = "origin info"; metadata.Primary = "Primary info"; metadata.Project = new ProjectIdentifier(); metadata.Project.Name = "Project1"; metadata.Project.Numbers.Add("101"); metadata.Project.Numbers.Add("201"); CitationReference reference = new CitationReference(); reference.Authors = "Authors"; reference.Consortiums = "Consortiums"; reference.Journal = "Journal"; reference.Location = "3"; reference.Medline = "Medline info"; reference.Number = 1; reference.PubMed = "pubmid"; reference.Remarks = "remarks"; reference.Title = "Title of the book"; metadata.References.Add(reference); reference = new CitationReference(); reference.Authors = "Authors"; reference.Consortiums = "Consortiums"; reference.Journal = "Journal"; reference.Location = "4"; reference.Medline = "Medline info"; reference.Number = 2; reference.PubMed = "pubmid"; reference.Remarks = "remarks"; reference.Title = "Title of the book"; metadata.References.Add(reference); metadata.Segment = new SequenceSegment(); metadata.Segment.Count = 2; metadata.Segment.Current = 1; metadata.Source = new SequenceSource(); metadata.Source.CommonName = "ABC Xyz"; metadata.Source.Organism.Genus = "ABC"; metadata.Source.Organism.Species = "Xyz"; metadata.Source.Organism.ClassLevels = "123 123"; metadata.Version = new GenBankVersion(); metadata.Version.Accession = "PAccession"; metadata.Version.Version = "1"; metadata.Version.GINumber = "12345"; GenBankMetadata clonemetadta = metadata.Clone(); Assert.AreEqual(clonemetadta.Accession.Primary, metadata.Accession.Primary); for (int i = 0; i < clonemetadta.Accession.Secondary.Count; i++) { Assert.AreEqual(clonemetadta.Accession.Secondary[i], metadata.Accession.Secondary[i]); } Assert.AreEqual(clonemetadta.BaseCount, metadata.BaseCount); for (int i = 0; i < clonemetadta.Comments.Count; i++) { Assert.AreEqual(clonemetadta.Comments[i], metadata.Comments[i]); } Assert.AreEqual(clonemetadta.Contig, metadata.Contig); Assert.AreEqual(clonemetadta.DBLink.Type, metadata.DBLink.Type); for (int i = 0; i < clonemetadta.DBLink.Numbers.Count; i++) { Assert.AreEqual(clonemetadta.DBLink.Numbers[i], metadata.DBLink.Numbers[i]); } Assert.AreEqual(clonemetadta.DBSource, metadata.DBSource); Assert.AreEqual(clonemetadta.Definition, metadata.Definition); for (int i = 0; i < clonemetadta.Features.All.Count; i++) { Assert.AreEqual(clonemetadta.Features.All[i].Key, metadata.Features.All[i].Key); Assert.AreEqual(locBuilder.GetLocationString(clonemetadta.Features.All[i].Location), locBuilder.GetLocationString(metadata.Features.All[i].Location)); foreach (KeyValuePair <string, List <string> > kvp in clonemetadta.Features.All[i].Qualifiers) { if (metadata.Features.All[i].Qualifiers.ContainsKey(kvp.Key)) { if (kvp.Value == null) { Assert.IsNull(metadata.Features.All[i].Qualifiers[kvp.Key]); } else { for (int j = 0; j < kvp.Value.Count; j++) { Assert.AreEqual(kvp.Value[j], metadata.Features.All[i].Qualifiers[kvp.Key][j]); } } } else { Assert.Fail(); } } } Assert.AreEqual(clonemetadta.Keywords, metadata.Keywords); Assert.AreEqual(clonemetadta.Locus.Date, metadata.Locus.Date); Assert.AreEqual(clonemetadta.Locus.DivisionCode, metadata.Locus.DivisionCode); Assert.AreEqual(clonemetadta.Locus.MoleculeType, metadata.Locus.MoleculeType); Assert.AreEqual(clonemetadta.Locus.Name, metadata.Locus.Name); Assert.AreEqual(clonemetadta.Locus.SequenceLength, metadata.Locus.SequenceLength); Assert.AreEqual(clonemetadta.Locus.SequenceType, metadata.Locus.SequenceType); Assert.AreEqual(clonemetadta.Locus.Strand, metadata.Locus.Strand); Assert.AreEqual(clonemetadta.Locus.StrandTopology, metadata.Locus.StrandTopology); Assert.AreEqual(clonemetadta.Origin, clonemetadta.Origin); Assert.AreEqual(clonemetadta.Primary, metadata.Primary); Assert.AreEqual(clonemetadta.Project.Name, metadata.Project.Name); for (int i = 0; i < clonemetadta.Project.Numbers.Count; i++) { Assert.AreEqual(clonemetadta.Project.Numbers[i], metadata.Project.Numbers[i]); } for (int i = 0; i < clonemetadta.References.Count; i++) { Assert.AreEqual(clonemetadta.References[i].Authors, metadata.References[i].Authors); Assert.AreEqual(clonemetadta.References[i].Consortiums, metadata.References[i].Consortiums); Assert.AreEqual(clonemetadta.References[i].Journal, metadata.References[i].Journal); Assert.AreEqual(clonemetadta.References[i].Location, metadata.References[i].Location); Assert.AreEqual(clonemetadta.References[i].Medline, metadata.References[i].Medline); Assert.AreEqual(clonemetadta.References[i].Number, metadata.References[i].Number); Assert.AreEqual(clonemetadta.References[i].PubMed, metadata.References[i].PubMed); Assert.AreEqual(clonemetadta.References[i].Remarks, metadata.References[i].Remarks); Assert.AreEqual(clonemetadta.References[i].Title, metadata.References[i].Title); } Assert.AreEqual(clonemetadta.Segment.Current, metadata.Segment.Current); Assert.AreEqual(clonemetadta.Segment.Count, metadata.Segment.Count); Assert.AreEqual(clonemetadta.Source.CommonName, metadata.Source.CommonName); Assert.AreEqual(clonemetadta.Source.Organism.ClassLevels, metadata.Source.Organism.ClassLevels); Assert.AreEqual(clonemetadta.Source.Organism.Genus, metadata.Source.Organism.Genus); Assert.AreEqual(clonemetadta.Source.Organism.Species, metadata.Source.Organism.Species); Assert.AreEqual(clonemetadta.Version.Accession, metadata.Version.Accession); Assert.AreEqual(clonemetadta.Version.CompoundAccession, metadata.Version.CompoundAccession); Assert.AreEqual(clonemetadta.Version.GINumber, metadata.Version.GINumber); Assert.AreEqual(clonemetadta.Version.Version, metadata.Version.Version); }