private void RefreshRouteTable() { var routeKey = new RouteKey(AppAssembly, AdditionalAssemblies); if (!routeKey.Equals(_routeTableLastBuiltForRouteKey)) { _routeTableLastBuiltForRouteKey = routeKey; Routes = RouteTableFactory.Create(routeKey); } }
public void RouteKey_WithAdditionalAssemblies_DifferentAdditionalAssemblies() { // Arrange var key1 = new RouteKey(typeof(ComponentBase).Assembly, new[] { typeof(object).Assembly }); var key2 = new RouteKey(typeof(ComponentBase).Assembly, new[] { GetType().Assembly, }); // Act & Assert Assert.Equal(key1.GetHashCode(), key2.GetHashCode()); Assert.False(key1.Equals(key2)); }
public void RouteKey_WithNoAdditionalAssemblies_DifferentAssemblies() { // Arrange var key1 = new RouteKey(typeof(string).Assembly, null); var key2 = new RouteKey(typeof(ComponentBase).Assembly, null); // Act & Assert Assert.NotEqual(key1.GetHashCode(), key2.GetHashCode()); Assert.False(key1.Equals(key2)); }
public void RouteKey_WithAdditionalAssemblies() { // Arrange var key1 = new RouteKey(typeof(string).Assembly, new[] { typeof(ComponentBase).Assembly, GetType().Assembly }); var key2 = new RouteKey(typeof(string).Assembly, new[] { typeof(ComponentBase).Assembly, GetType().Assembly }); // Act & Assert Assert.Equal(key1.GetHashCode(), key2.GetHashCode()); Assert.True(key1.Equals(key2)); }
public void RouteKey_WithNoAdditionalAssemblies_Equality() { // Arrange var key1 = new RouteKey(typeof(string).Assembly, null); var key2 = new RouteKey(typeof(string).Assembly, null); // Act & Assert Assert.Equal(key1.GetHashCode(), key2.GetHashCode()); Assert.True(key1.Equals(key2)); }