public void GenerateCoordinateTest() { var coordinate = RandomData.GenerateCoordinate <Coordinate>(); Assert.IsNotNull(coordinate); Assert.IsNotNull(coordinate.ToString()); }
public void FirstOrNull() { var coord = RandomData.GenerateCoordinate <CoordinateProper>(); var result = base.coordinateArray.FirstOrNull(p => p.X == coord.X); base.Consumer.Consume(result); }
public void GetMaxTest() { var cord1 = RandomData.GenerateCoordinate <CoordinateProper>(); var cord2 = RandomData.GenerateCoordinate <CoordinateProper>(); var result = cord1.Max(cord2); Assert.IsNotNull(result); }
public void PropertiesToStringTest() { var personRecord = RandomData.GeneratePersonRecordCollection(1).First(); var propertiesTest = new PropertiesTest { Id = RandomData.GenerateKey(), PersonProper = RandomData.GenerateRefPerson <PersonProper>(), PersonRecord = RandomData.GeneratePersonRecordCollection(1).First(), Today = DateTimeOffset.Now, ClosedOn = DateTimeOffset.Now, }; var result = personRecord.PropertiesToString( header: "PersonRecord", keyValueSeparator: ':', sequenceSeparator: ", ", ignoreNulls: true); Assert.IsTrue(result.Length > 1300); Assert.IsTrue(result.Contains("Addresses")); PrintResult(result, nameof(this.PropertiesToStringTest)); result = propertiesTest.PropertiesToString( header: "PersonRecord", keyValueSeparator: ':', sequenceSeparator: ", ", ignoreNulls: true, includeMemberName: false); Assert.IsTrue(result.Length > 1300); Assert.IsTrue(result.Contains("Addresses")); PrintResult(result, nameof(this.PropertiesToStringTest)); var person = RandomData.GenerateRefPerson <PersonProper>(); result = person.PropertiesToString(header: person.Id); Assert.IsTrue(result.Length > 500); Assert.IsTrue(result.Contains("Address1")); PrintResult(result, nameof(this.PropertiesToStringTest)); var coordinate = RandomData.GenerateCoordinate <CoordinateProper>(); result = coordinate.PropertiesToString(); Assert.IsTrue(result.Length > 50); Assert.IsTrue(result.Contains("X")); PrintResult(result, nameof(this.PropertiesToStringTest)); var personCollection = RandomData.GeneratePersonRecordCollection(5); result = personCollection.PropertiesToString(); Assert.IsTrue(result.Contains("LastName")); Assert.IsTrue(result.Length > 6000); }
public void ContainsAnyTest() { var collection = RandomData.GenerateCoordinateCollection <Coordinate>(10).ToList(); var emptyCollection = new PersonCollection <PersonProper>(); var coordinate = RandomData.GenerateCoordinate <Coordinate>(); //Test params Assert.IsFalse(collection.ContainsAny()); Assert.IsFalse(collection.ToArray().ContainsAny()); Assert.IsFalse(emptyCollection.ContainsAny()); Assert.IsFalse(collection.ContainsAny(coordinate)); collection.Add(coordinate); Assert.IsTrue(collection.ContainsAny(coordinate)); Assert.IsTrue(collection.ToArray().ContainsAny(coordinate)); }