Beispiel #1
0
            public void YesterdaysVisitNotListed()
            {
                //Arrange
                string login  = "******";
                Visit  visit1 = new Visit()
                {
                    ExpectedVisitDate = DateTime.Now.Date.AddDays(-1), Patient = new Patient()
                    {
                        Doctor = new User()
                        {
                            Login = login
                        }
                    }
                };

                Mock <IDataStorage> dataStorage = new Mock <IDataStorage>();

                dataStorage.Setup(ds => ds.GetData <Visit>()).Returns(new List <Visit> {
                    visit1
                });
                VisitRepository repository = new VisitRepository(dataStorage.Object);
                //Act
                IList <Visit> result = repository.GetDailyVisits(login, DateTime.Now.Date);

                //Assert
                Assert.That(result, Is.Not.Null);
                Assert.That(result.Count, Is.EqualTo(0));
            }
Beispiel #2
0
            public void SingleExpectedToday()
            {
                //Arrange
                string login  = "******";
                Visit  visit1 = new Visit()
                {
                    ExpectedVisitDate = DateTime.Now.Date, Patient = new Patient()
                    {
                        Doctor = new User()
                        {
                            Login = login
                        }, IsActive = true
                    }
                };

                Mock <IDataStorage> dataStorage = new Mock <IDataStorage>();

                dataStorage.Setup(ds => ds.GetData <Visit>()).Returns(new List <Visit> {
                    visit1
                });
                VisitRepository repository = new VisitRepository(dataStorage.Object);
                //Act
                IList <Visit> result = repository.GetDailyVisits(login, DateTime.Now.Date);

                //Assert
                Assert.That(result, Is.Not.Null);
                Assert.That(result.Count, Is.EqualTo(1));
                Assert.That(result[0], Is.EqualTo(visit1));
            }
            public void YesterdaysVisitNotListed()
            {
                //Arrange
                string login = "******";
                Visit visit1 = new Visit() { ExpectedVisitDate = DateTime.Now.Date.AddDays(-1), Patient = new Patient() { Doctor = new User() { Login = login } } };

                Mock<IDataStorage> dataStorage = new Mock<IDataStorage>();
                dataStorage.Setup(ds => ds.GetData<Visit>()).Returns(new List<Visit> {visit1});
                VisitRepository repository = new VisitRepository(dataStorage.Object);
                //Act
                IList<Visit> result = repository.GetDailyVisits(login, DateTime.Now.Date);

                //Assert
                Assert.That(result, Is.Not.Null);
                Assert.That(result.Count, Is.EqualTo(0));
            }
            public void SingleExpectedToday()
            {
                //Arrange
                string login = "******";
                Visit visit1 = new Visit() { ExpectedVisitDate = DateTime.Now.Date, Patient = new Patient() { Doctor = new User() { Login = login }, IsActive = true } };

                Mock<IDataStorage> dataStorage = new Mock<IDataStorage>();
                dataStorage.Setup(ds => ds.GetData<Visit>()).Returns(new List<Visit> {visit1});
                VisitRepository repository = new VisitRepository(dataStorage.Object);
                //Act
                IList<Visit> result = repository.GetDailyVisits(login, DateTime.Now.Date);

                //Assert
                Assert.That(result, Is.Not.Null);
                Assert.That(result.Count, Is.EqualTo(1));
                Assert.That(result[0], Is.EqualTo(visit1));
            }