1 // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
2 
3 using Xunit;
4 
5 namespace System.Web.Mvc.Test
6 {
7     public class ControllerDescriptorCacheTest
8     {
9         [Fact]
GetDescriptor()10         public void GetDescriptor()
11         {
12             // Arrange
13             Type controllerType = typeof(object);
14             ControllerDescriptorCache cache = new ControllerDescriptorCache();
15 
16             // Act
17             ControllerDescriptor descriptor1 = cache.GetDescriptor(controllerType, () => new ReflectedControllerDescriptor(controllerType));
18             ControllerDescriptor descriptor2 = cache.GetDescriptor(controllerType, () => new ReflectedControllerDescriptor(controllerType));
19 
20             // Assert
21             Assert.Same(controllerType, descriptor1.ControllerType);
22             Assert.Same(descriptor1, descriptor2);
23         }
24     }
25 }
26