public void ThrowExceptionWithNullLogger() { var metadataMock = new Mock<IRequestMetadata>(); var requestContext = new DummyObjectContext(); Assert.Throws<ArgumentNullException>(() => new RuntimePolicyContext(metadataMock.Object, null, requestContext)); }
public void ThrowExceptionWithNullLogger() { var metadataMock = new Mock <IRequestMetadata>(); var requestContext = new DummyObjectContext(); Assert.Throws <ArgumentNullException>(() => new RuntimePolicyContext(metadataMock.Object, null, requestContext)); }
public void CallAbstractConvert() { var converterMock = new Mock<SerializationConverter<DummyObjectContext>>(); var objContext = new DummyObjectContext(); converterMock.Object.Convert(objContext); converterMock.Verify(c=>c.Convert(objContext), Times.Once()); }
public void CallAbstractConvert() { var converterMock = new Mock <SerializationConverter <DummyObjectContext> >(); var objContext = new DummyObjectContext(); converterMock.Object.Convert(objContext); converterMock.Verify(c => c.Convert(objContext), Times.Once()); }
public TabContextShould() { RequestContext = new DummyObjectContext(); PluginStoreMock = new Mock <IDataStore>(); LoggerMock = new Mock <ILogger>(); MessageBroker = new Mock <IMessageBroker>(); Inspectors = new ReflectionDiscoverableCollection <IInspector>(LoggerMock.Object) { new DummyInspector1() }; }
public TabContextShould() { RequestContext = new DummyObjectContext(); PluginStoreMock = new Mock<IDataStore>(); LoggerMock = new Mock<ILogger>(); MessageBroker = new Mock<IMessageBroker>(); Inspectors = new ReflectionDiscoverableCollection<IInspector>(LoggerMock.Object) { new DummyInspector1() }; }
public void Constuct() { var metadataMock = new Mock <IRequestMetadata>(); var loggerMock = new Mock <ILogger>(); var requestContext = new DummyObjectContext(); var context = new RuntimePolicyContext(metadataMock.Object, loggerMock.Object, requestContext); Assert.Equal(metadataMock.Object, context.RequestMetadata); Assert.Equal(loggerMock.Object, context.Logger); Assert.Equal(requestContext, context.GetRequestContext <DummyObjectContext>()); }
public void Constuct() { var metadataMock = new Mock<IRequestMetadata>(); var loggerMock = new Mock<ILogger>(); var requestContext = new DummyObjectContext(); var context = new RuntimePolicyContext(metadataMock.Object, loggerMock.Object, requestContext); Assert.Equal(metadataMock.Object, context.RequestMetadata); Assert.Equal(loggerMock.Object, context.Logger); Assert.Equal(requestContext, context.GetRequestContext<DummyObjectContext>()); }
public void Remove() { var item = new DummyObjectContext(); var collection = new ReflectionDiscoverableCollection <DummyObjectContext>(Collection.LoggerMock.Object) { item }; Assert.Equal(1, collection.Count); collection.Remove(item); Assert.Empty(collection); }