public void BuildWithDataSource() { var builder = new ConfigDriveBuilder(); var dsMock = new Mock <IConfigDriveDataSource>(); dsMock.Setup(x => x.ValidateNetworkData(It.IsAny <NetworkData>())).Verifiable(); builder.With(dsMock.Object); var configDrive = builder.Build(); configDrive.SetNetworkData(new NetworkData(new Dictionary <string, object>())); dsMock.Verify(); }
public void ThrowsIfBuildWithoutDataSource() { var builder = new ConfigDriveBuilder(); Assert.Throws <CloudInitConfigurationException>(() => builder.Build()); }