Ejemplo n.º 1
0
        public void ValidateCoreEntriesServiceRequired()
        {
            var entry = new Domain2.Hours.Hours();

            entry.Date      = DateTime.Now.AddDays(-1);
            entry.StartTime = new TimeSpan(1, 2, 3);
            entry.EndTime   = new TimeSpan(2, 3, 4);
            entry.Provider  = new Domain2.Providers.Provider()
            {
                ProviderTypeID = 17
            };
            entry.Memo    = "asdf";
            entry.Service = null;

            var resolver = new CoreValidations(_resolutionServiceMock.Object, _resolutionServiceRepositoryMock.Object);

            bool result = resolver.ValidateCoreRequirements(entry);

            Assert.IsFalse(result);
        }
Ejemplo n.º 2
0
        public void ValidateCoreEntriesIgnoresExtendedNotesOnBasicType()
        {
            var entry = new Domain2.Hours.Hours();

            entry.Date      = DateTime.Now.AddDays(-1);
            entry.StartTime = new TimeSpan(1, 2, 3);
            entry.EndTime   = new TimeSpan(2, 3, 4);
            entry.Provider  = new Domain2.Providers.Provider()
            {
                ProviderTypeID = 15
            };
            entry.ExtendedNotes = new List <Domain2.Hours.ExtendedNote>();
            entry.Service       = new Domain2.Services.Service();

            _resolutionServiceMock.Setup(x => x.EntryType).Returns(EntryType.Basic);
            var resolver = new CoreValidations(_resolutionServiceMock.Object, _resolutionServiceRepositoryMock.Object);

            bool result = resolver.ValidateCoreRequirements(entry);

            Assert.IsTrue(result);
        }