예제 #1
0
        public void InitialiseLoadsTheSpaceCorrectlyForMultipleDrives()
        {
            var server        = mocks.Create <ICruiseServer>().Object;
            var extension     = new DiskSpaceMonitorExtension();
            var configuration = new ExtensionConfiguration();

            configuration.Items = new XmlElement[] {
                CreateSizeElement("Mb", 100, "C:\\"), CreateSizeElement("Kb", 100, "D:\\")
            };
            extension.Initialise(server, configuration);
            Assert.AreEqual(104857600, extension.RetrieveMinimumSpaceRequired("C:\\"));
            Assert.AreEqual(102400, extension.RetrieveMinimumSpaceRequired("D:\\"));
        }
        public void InitialiseLoadsTheSpaceCorrectlyForMissing()
        {
            var server        = mocks.DynamicMock <ICruiseServer>();
            var extension     = new DiskSpaceMonitorExtension();
            var configuration = new ExtensionConfiguration();

            configuration.Items = new XmlElement[] {
                CreateSizeElement(null, 100, "C:\\")
            };
            extension.Initialise(server, configuration);
            Assert.AreEqual(104857600, extension.RetrieveMinimumSpaceRequired("C:\\"));
        }