示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ComparisonViewModel"/> class.
        /// </summary>
        /// <param name="favouritesManager">The favourites manager.</param>
        /// <param name="a">The first gneome to compare.</param>
        /// <param name="b">The optional second genome to compare, can be <see langword="null"/>.</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="favouritesManager"/> or <paramref name="a"/> is <see langword="null"/>.
        /// </exception>
        public ComparisonViewModel(IFavouritesManager favouritesManager, GenomeModel a, GenomeModel b = null)
        {
            Guard.IsNotNull(favouritesManager, nameof(favouritesManager));
            Guard.IsNotNull(a, nameof(a));

            _favouritesManager = favouritesManager;
            Snp = new SnpViewModelCollection(MakeSnpViewModels(a, b));
        }
        public void Ctor_CorrectlyInitializesMembers_Test()
        {
            var expected = new[]
            {
                new SnpViewModel(TestSnpModel.Create(), null),
                new SnpViewModel(TestSnpModel.Create(), null),
            };

            var actual = new SnpViewModelCollection(expected);

            Assert.True(expected.SequenceEqual(actual));
        }