public void Site_Set_GetReturnsExpected() { var component = new SubComponent(); Assert.Null(component.Site); var site = new MockSite(); component.Site = site; Assert.Same(site, component.Site); }
public void DesignMode_GetWithSite_ReturnsExpected(bool result) { var site = new MockSite { DesignMode = result }; var component = new SubComponent { Site = site }; Assert.Equal(result, component.DesignMode); }
public void Container_GetWithSite_ReturnsExpected(Container result) { var site = new MockSite { Container = result }; var component = new Component { Site = site }; Assert.Same(result, component.Container); }
public void GetService_InvokeWithSite_ReturnsExpected(Type serviceType, Type result) { var site = new MockSite { ServiceType = result }; var component = new SubComponent { Site = site }; Assert.Same(result, component.GetService(serviceType)); }
public void GetServiceType_CustomSite_ReturnsExpected() { var component = new SubComponent(); Assert.Null(component.GetServiceInternal(typeof(int))); var site = new MockSite { ServiceType = typeof(bool) }; component.Site = site; Assert.Equal(typeof(bool), component.GetServiceInternal(typeof(int))); }
public void DesignMode_Set_GetReturnsExpected() { var component = new SubComponent(); Assert.False(component.GetDesignMode()); var site = new MockSite { DesignMode = true }; component.Site = site; Assert.True(component.GetDesignMode()); }
public void Container_Set_GetReturnsExpected() { var component = new SubComponent(); Assert.Null(component.Container); var site = new MockSite { Container = new Container() }; component.Site = site; Assert.Same(site.Container, component.Container); }
public void Dispose_NonNullSiteContainer_RemovesComponentFromContainer() { var site = new MockSite { Container = new Container() }; var component = new SubComponent { Site = site }; component.Dispose(); Assert.Null(component.Site); component.Dispose(); Assert.Null(component.Site); }
public void Dispose_NullSiteContainer_Success() { var site = new MockSite { Container = null }; var component = new SubComponent { Site = site }; component.Dispose(); Assert.Same(site, component.Site); component.Dispose(); Assert.Same(site, component.Site); }