public void Ctor_CorrectlyInitializesMembers_Test()
        {
            var expected = new[] { TestSnpModel.Create("rsXXX1"), TestSnpModel.Create("rsXXX2") };

            var actual = new SnpModelCollection(expected);

            Assert.True(actual.SequenceEqual(actual));
        }
        public void GetByIdOrDefault_WhenSnpExists_ReturnsSnpModel_Test()
        {
            var expected = TestSnpModel.Create();

            var collection = new SnpModelCollection(new[] { expected });
            var actual     = collection.GetByIdOrDefault(expected.Id);

            Assert.Same(expected, actual);
        }
        public void GetByIdOrDefault_WhenSnpDoesNotExists_ReturnsNull_Test()
        {
            var collection = new SnpModelCollection(new SnpModel[0]);

            Assert.Null(collection.GetByIdOrDefault("rsXXXX"));
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GenomeModel"/> class.
        /// </summary>
        /// <param name="snp">The sequence of <see cref="SnpModel"/> instances that make up the genome.</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when <paramref name="snp"/> is <see langword="null"/>.
        /// </exception>
        public GenomeModel(IEnumerable <SnpModel> snp)
        {
            Guard.IsNotNull("snp", nameof(snp));

            Snp = new SnpModelCollection(snp);
        }