public void GetDescriptor() {
            // Arrange
            Type controllerType = typeof(object);
            AsyncControllerDescriptorCache cache = new AsyncControllerDescriptorCache();

            // Act
            ControllerDescriptor descriptor1 = cache.GetDescriptor(controllerType);
            ControllerDescriptor descriptor2 = cache.GetDescriptor(controllerType);

            // Assert
            Assert.AreSame(controllerType, descriptor1.ControllerType, "ControllerType was incorrect.");
            Assert.AreSame(descriptor1, descriptor2, "Selector was not correctly cached.");
        }
コード例 #2
0
        public void GetDescriptor()
        {
            // Arrange
            Type controllerType = typeof(object);
            AsyncControllerDescriptorCache cache = new AsyncControllerDescriptorCache();

            // Act
            ControllerDescriptor descriptor1 = cache.GetDescriptor(controllerType);
            ControllerDescriptor descriptor2 = cache.GetDescriptor(controllerType);

            // Assert
            Assert.AreSame(controllerType, descriptor1.ControllerType, "ControllerType was incorrect.");
            Assert.AreSame(descriptor1, descriptor2, "Selector was not correctly cached.");
        }