예제 #1
0
        public void SpellingsContainsCorrectMembersForCurrentTest()
        {
            IConnectedRepository repo = new MockConectedRepository();
            var sut      = new TestListViewModel(repo);
            var testList = sut.Tests;
            var test     = sut.Tests.SingleOrDefault(f => f.Id == 2);

            // Act
            sut.CurrentTest = test;

            // Assert
            Assert.Equal(3, sut.Spellings.Count);

            Assert.Contains(sut.Spellings, s => s.Word == "Five");
        }
예제 #2
0
        public void ListContainsCorrectNumberOfSpellTests()
        {
            //Mock<IConnectedRepository> repo = new Mock<IConnectedRepository>();
            IConnectedRepository repo = new MockConectedRepository();
            var sut = new TestListViewModel(repo);

            var testList = sut.Tests;

            Assert.Equal(2, testList.Count);

            var test = sut.Tests.SingleOrDefault(f => f.Id == 1);

            Assert.Equal("Test 1", test.Description);
            Assert.Equal(new DateTime(2017, 1, 1), test.DateCreated);
        }