public void IsCollectionRegistered_CollectionRegisteredAndDropped_False()
        {
            TestInstance.RegisterCollection(Collection, Descriptor, DataBuilder);
            TestInstance.DropCollection(Collection);

            Assert.IsFalse(TestInstance.IsCollectionRegistered(Collection));
        }
        public void IsCollectionRegisteredWithDescriptor_CollectionRegisteredWithOther_False()
        {
            var otherDescriptor = new Mock <INonTerminalDescriptor>().Object;

            TestInstance.RegisterCollection(Collection, Descriptor, DataBuilder);

            Assert.IsFalse(TestInstance.IsCollectionRegisteredWithDescriptor(Collection, otherDescriptor));
        }
        public void GetDescriptor_CollectionRegisteredTwice_CorrectDescriptor()
        {
            var descriptorOne = new Mock <INonTerminalDescriptor>().Object;
            var descriptorTwo = new Mock <INonTerminalDescriptor>().Object;

            TestInstance.RegisterCollection(Collection, descriptorOne, DataBuilder);
            TestInstance.RegisterCollection(Collection, descriptorTwo, DataBuilder);

            Assert.AreSame(descriptorTwo, TestInstance.GetDescriptor(Collection));
        }
        public async Task BuildCollectionAsync__ItemsBuildUsingRegisteredBuilder()
        {
            var collection = new List <IData>()
            {
                new Mock <IData>().Object, new Mock <IData>().Object
            };

            TestInstance.RegisterCollection(collection, Descriptor, DataBuilder);

            await TestInstance.BuildCollectionAsync(collection);

            foreach (var item in collection)
            {
                MockedDataBuilder.Verify(_ => _.DoWorkAsync(item));
            }
        }
        public async Task ChangeBuilderAsync__ItemsBuildUsingChangedBuilder()
        {
            var collection = new List <IData>()
            {
                new Mock <IData>().Object, new Mock <IData>().Object
            };
            var mockedDataBuilder = new Mock <IDataBuilder <IData> >();
            var dataBuilder       = mockedDataBuilder.Object;

            TestInstance.RegisterCollection(collection, Descriptor, DataBuilder);
            await TestInstance.ChangeBuilderAsync(collection, dataBuilder);

            foreach (var item in collection)
            {
                mockedDataBuilder.Verify(_ => _.DoWorkAsync(item));
            }
        }
        public void GetDescriptor_RegisteredCollection_CorrectDescriptor()
        {
            TestInstance.RegisterCollection(Collection, Descriptor, DataBuilder);

            Assert.AreSame(Descriptor, TestInstance.GetDescriptor(Collection));
        }
        public void IsCollectionRegisteredWithDescriptor_CollectionRegisteredWithDescriptor_True()
        {
            TestInstance.RegisterCollection(Collection, Descriptor, DataBuilder);

            Assert.IsTrue(TestInstance.IsCollectionRegisteredWithDescriptor(Collection, Descriptor));
        }
        public void IsCollectionRegistered_RegisteredCollection_True()
        {
            TestInstance.RegisterCollection(Collection, Descriptor, DataBuilder);

            Assert.IsTrue(TestInstance.IsCollectionRegistered(Collection));
        }